Commit f78d0c53 authored by shenyong's avatar shenyong

广告收入上报

parent 766549b8
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
042EF7462DD4A3F90028DE2C /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 042EF7452DD4A3F90028DE2C /* Kingfisher */; }; 042EF7462DD4A3F90028DE2C /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 042EF7452DD4A3F90028DE2C /* Kingfisher */; };
046463832DDF5A48008C852D /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 046463822DDF5A48008C852D /* FirebaseAnalytics */; };
046463852DDF5A48008C852D /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = 046463842DDF5A48008C852D /* FirebaseCore */; };
0496DEF32D9E3F58005B2834 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BD915D2D9D68AD00055CEB /* WidgetKit.framework */; }; 0496DEF32D9E3F58005B2834 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BD915D2D9D68AD00055CEB /* WidgetKit.framework */; };
0496DEF42D9E3F58005B2834 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BD915F2D9D68AD00055CEB /* SwiftUI.framework */; }; 0496DEF42D9E3F58005B2834 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BD915F2D9D68AD00055CEB /* SwiftUI.framework */; };
0496DEFF2D9E3F59005B2834 /* widgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 0496DEF22D9E3F57005B2834 /* widgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 0496DEFF2D9E3F59005B2834 /* widgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 0496DEF22D9E3F57005B2834 /* widgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
...@@ -210,8 +212,10 @@ ...@@ -210,8 +212,10 @@
04C299E22DDE02530054D76C /* AdSupport.framework in Frameworks */, 04C299E22DDE02530054D76C /* AdSupport.framework in Frameworks */,
042EF7462DD4A3F90028DE2C /* Kingfisher in Frameworks */, 042EF7462DD4A3F90028DE2C /* Kingfisher in Frameworks */,
3A00E856852A8783E544CD7D /* Pods_PhoneManager.framework in Frameworks */, 3A00E856852A8783E544CD7D /* Pods_PhoneManager.framework in Frameworks */,
046463852DDF5A48008C852D /* FirebaseCore in Frameworks */,
04CA06622DDDB40E009A15E3 /* KeychainSwift in Frameworks */, 04CA06622DDDB40E009A15E3 /* KeychainSwift in Frameworks */,
04EC294B2DD33B480049739A /* GoogleSignIn in Frameworks */, 04EC294B2DD33B480049739A /* GoogleSignIn in Frameworks */,
046463832DDF5A48008C852D /* FirebaseAnalytics in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -402,6 +406,7 @@ ...@@ -402,6 +406,7 @@
04EC26182DD33B070049739A /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */, 04EC26182DD33B070049739A /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */,
042EF7442DD4A3780028DE2C /* XCRemoteSwiftPackageReference "Kingfisher" */, 042EF7442DD4A3780028DE2C /* XCRemoteSwiftPackageReference "Kingfisher" */,
04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */, 04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */,
046463812DDF5A1F008C852D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
); );
preferredProjectObjectVersion = 77; preferredProjectObjectVersion = 77;
productRefGroup = EB388E5C2D8A61A800629B0D /* Products */; productRefGroup = EB388E5C2D8A61A800629B0D /* Products */;
...@@ -1027,6 +1032,14 @@ ...@@ -1027,6 +1032,14 @@
minimumVersion = 8.3.2; minimumVersion = 8.3.2;
}; };
}; };
046463812DDF5A1F008C852D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 11.13.0;
};
};
04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */ = { 04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */ = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/evgenyneu/keychain-swift.git"; repositoryURL = "https://github.com/evgenyneu/keychain-swift.git";
...@@ -1051,6 +1064,16 @@ ...@@ -1051,6 +1064,16 @@
package = 042EF7442DD4A3780028DE2C /* XCRemoteSwiftPackageReference "Kingfisher" */; package = 042EF7442DD4A3780028DE2C /* XCRemoteSwiftPackageReference "Kingfisher" */;
productName = Kingfisher; productName = Kingfisher;
}; };
046463822DDF5A48008C852D /* FirebaseAnalytics */ = {
isa = XCSwiftPackageProductDependency;
package = 046463812DDF5A1F008C852D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalytics;
};
046463842DDF5A48008C852D /* FirebaseCore */ = {
isa = XCSwiftPackageProductDependency;
package = 046463812DDF5A1F008C852D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseCore;
};
04CA06612DDDB40E009A15E3 /* KeychainSwift */ = { 04CA06612DDDB40E009A15E3 /* KeychainSwift */ = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */; package = 04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */;
......
{ {
"originHash" : "de1a4dc6f64c5ce471b3f7c477ef76458170ad953fc5100955926b1f2889707a", "originHash" : "0a8c3ee25d7eac0fa9660a6e4aa750a639cc174d7ec9a5272abc8f3890465e39",
"pins" : [ "pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5",
"version" : "1.2024072200.0"
}
},
{ {
"identity" : "app-check", "identity" : "app-check",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
...@@ -19,6 +28,33 @@ ...@@ -19,6 +28,33 @@
"version" : "1.7.6" "version" : "1.7.6"
} }
}, },
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "3663b1aa6c7a1bed67ee80fd09dc6d0f9c3bb660",
"version" : "11.13.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "543071966b3fb6613a2fc5c6e7112d1e998184a7",
"version" : "11.13.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
"version" : "10.1.0"
}
},
{ {
"identity" : "googlesignin-ios", "identity" : "googlesignin-ios",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
...@@ -37,6 +73,15 @@ ...@@ -37,6 +73,15 @@
"version" : "8.1.0" "version" : "8.1.0"
} }
}, },
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "cc0001a0cf963aa40501d9c2b181e7fc9fd8ec71",
"version" : "1.69.0"
}
},
{ {
"identity" : "gtm-session-fetcher", "identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
...@@ -55,6 +100,15 @@ ...@@ -55,6 +100,15 @@
"version" : "4.1.1" "version" : "4.1.1"
} }
}, },
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
"version" : "101.0.0"
}
},
{ {
"identity" : "keychain-swift", "identity" : "keychain-swift",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
...@@ -73,6 +127,24 @@ ...@@ -73,6 +127,24 @@
"version" : "8.3.2" "version" : "8.3.2"
} }
}, },
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{ {
"identity" : "promises", "identity" : "promises",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
...@@ -81,6 +153,15 @@ ...@@ -81,6 +153,15 @@
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0" "version" : "2.4.0"
} }
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "d72aed98f8253ec1aa9ea1141e28150f408cf17f",
"version" : "1.29.0"
}
} }
], ],
"version" : 3 "version" : 3
......
...@@ -12,7 +12,7 @@ import GoogleMobileAds ...@@ -12,7 +12,7 @@ import GoogleMobileAds
import UserMessagingPlatform import UserMessagingPlatform
import GoogleSignIn import GoogleSignIn
import AdjustSdk import AdjustSdk
import FirebaseCore
@main @main
class AppDelegate: UIResponder, UIApplicationDelegate { class AppDelegate: UIResponder, UIApplicationDelegate {
...@@ -40,6 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -40,6 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
widgetAppgourp.share.PushWidgetData(battery: Int(battery), storage: Int(storage)) widgetAppgourp.share.PushWidgetData(battery: Int(battery), storage: Int(storage))
//初始化adjust //初始化adjust
let yourAppToken = "6mouvwgw7ksg" let yourAppToken = "6mouvwgw7ksg"
...@@ -68,6 +69,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -68,6 +69,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// 初始化广告SDK // 初始化广告SDK
AdvManager.shared.initAdertisementSDK() AdvManager.shared.initAdertisementSDK()
FirebaseApp.configure()
PMEmailManager.shareManager.restore() PMEmailManager.shareManager.restore()
SettingConfiguration.share.initData() SettingConfiguration.share.initData()
HapticManager.share.setupHapticEngine() HapticManager.share.setupHapticEngine()
...@@ -79,26 +81,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -79,26 +81,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
Adjust.attribution { attribution in Adjust.attribution { attribution in
// Print("获取归因数据11",attribution?.jsonResponse) Print("获取当前归因信息",attribution as Any)
// if let dic = attribution?.jsonResponse{
// let pram = self.convertToSwiftDictionary(dic as NSDictionary)
// APIReportManager.shared.startReport(type: .source_atrribute,ext: pram)
// }
// let pram = [ // let pram = [
// "trackerToken":attribution?.trackerToken ?? "", // "tracker_token":attribution?.trackerToken ?? "",
// "trackerName":attribution?.trackerName ?? "", // "tracker_name":attribution?.trackerName ?? "",
// "network":attribution?.network ?? "", // "network":attribution?.network ?? "",
// "campaign":attribution?.campaign ?? "", // "campaign":attribution?.campaign ?? "",
// "adgroup":attribution?.adgroup ?? "", // "adgroup":attribution?.adgroup ?? "",
// "creative":attribution?.creative ?? "", // "creative":attribution?.creative ?? "",
// "clickLabel":attribution?.clickLabel ?? "", // "click_label":attribution?.clickLabel ?? "",
// "costType":attribution?.costType ?? "", // "cost_type":attribution?.costType ?? "",
// "costAmount":attribution?.costAmount ?? "", // "cost_amount":attribution?.costAmount ?? "",
// "costCurrency":attribution?.costCurrency ?? "", // "cost_currency":attribution?.costCurrency ?? "0"
// ] // ]
// let dic = attribution.jso
Print("获取当前归因信息",attribution?.jsonResponse as Any)
//APIReportManager.shared.startReport(type: .source_atrribute,ext: pram)
// Print("归因字典",pram)
// Print("归因json",attribution?.jsonResponse)
} }
PMLoadingHUD.share.config() PMLoadingHUD.share.config()
...@@ -225,5 +227,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -225,5 +227,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return GIDSignIn.sharedInstance.handle(url) return GIDSignIn.sharedInstance.handle(url)
} }
func convertToSwiftDictionary(_ nsDict: NSDictionary) -> [String: Any] {
return nsDict as? [String: Any] ?? [:]
}
} }
...@@ -62,8 +62,11 @@ extension AppDelegate:AdjustDelegate{ ...@@ -62,8 +62,11 @@ extension AppDelegate:AdjustDelegate{
func adjustAttributionChanged(_ attribution: ADJAttribution?) { func adjustAttributionChanged(_ attribution: ADJAttribution?) {
guard let attribution = attribution else { return } guard let attribution = attribution else { return }
// 可以将这些数据上报给自己的服务器或者做其他处理
print("归因变化数据:", attribution.jsonResponse)
Print("归因变化数据",attribution.jsonResponse as Any)
if let dic = attribution.jsonResponse{
let pram = self.convertToSwiftDictionary(dic as NSDictionary)
APIReportManager.shared.startReport(type: .source_atrribute,ext: pram)
}
} }
} }
...@@ -114,11 +114,7 @@ class IAPManager: NSObject { ...@@ -114,11 +114,7 @@ class IAPManager: NSObject {
// 是否热启动 // 是否热启动
var isHotLaunch:Bool = false var isHotLaunch:Bool = false
// 订阅状态 // 订阅状态
var subscriptionType:SubscriptionType = .none{ var subscriptionType:SubscriptionType = .none
didSet{
isSubscribed = subscriptionType != .none
}
}
func config(){} func config(){}
......
...@@ -10,6 +10,7 @@ import GoogleMobileAds ...@@ -10,6 +10,7 @@ import GoogleMobileAds
import UserMessagingPlatform import UserMessagingPlatform
import AppTrackingTransparency import AppTrackingTransparency
import AdSupport import AdSupport
import AppLovinSDK
enum AdvertisementType { enum AdvertisementType {
case rewardedInterstitialType case rewardedInterstitialType
...@@ -20,12 +21,12 @@ enum AdvertisementType { ...@@ -20,12 +21,12 @@ enum AdvertisementType {
class AdvManager : NSObject, FullScreenContentDelegate { class AdvManager : NSObject, FullScreenContentDelegate {
// fixme:上线前更改 // fixme:上线前更改
// private static let REWARDED_INTERSTITIALAD_KEY : String = "ca-app-pub-3480207748580737/4276457203" private static let REWARDED_INTERSTITIALAD_KEY : String = "ca-app-pub-3480207748580737/4276457203"
// private static let INTERSTITIALAD_KEY : String = "ca-app-pub-3480207748580737/5836950888" private static let INTERSTITIALAD_KEY : String = "ca-app-pub-3480207748580737/5836950888"
// info.plist: ca-app-pub-3480207748580737~4236262472 // info.plist: ca-app-pub-3480207748580737~4236262472
private static let REWARDED_INTERSTITIALAD_KEY : String = "ca-app-pub-3940256099942544/6978759866" // private static let REWARDED_INTERSTITIALAD_KEY : String = "ca-app-pub-3940256099942544/6978759866"
private static let INTERSTITIALAD_KEY : String = "ca-app-pub-3940256099942544/4411468910" // private static let INTERSTITIALAD_KEY : String = "ca-app-pub-3940256099942544/4411468910"
static let shared : AdvManager = AdvManager() static let shared : AdvManager = AdvManager()
...@@ -94,14 +95,26 @@ class AdvManager : NSObject, FullScreenContentDelegate { ...@@ -94,14 +95,26 @@ class AdvManager : NSObject, FullScreenContentDelegate {
/// 初始化SDK /// 初始化SDK
func initAdertisementSDK() { func initAdertisementSDK() {
// Initialize the Google Mobile Ads SDK. ALPrivacySettings.setDoNotSell(true)
MobileAds.shared.start()
// Request an ad. MobileAds.shared.start { status in
let adapterStatuses = status.adapterStatusesByClassName
for adapter in adapterStatuses {
let adapterStatus = adapter.value
NSLog("Adapter Name: %@, Description: %@, Latency: %f", adapter.key,
adapterStatus.description, adapterStatus.latency)
}
Task { Task {
// 同时load两个广告内容 // 同时load两个广告内容
await self.loadInterstitial() await self.loadInterstitial()
await self.loadRewardedInterstitialAd() await self.loadRewardedInterstitialAd()
} }
// 隐私设置
ALPrivacySettings.setHasUserConsent(true)
}
} }
/// 获取激励插页广告 /// 获取激励插页广告
...@@ -112,6 +125,26 @@ class AdvManager : NSObject, FullScreenContentDelegate { ...@@ -112,6 +125,26 @@ class AdvManager : NSObject, FullScreenContentDelegate {
rewardedInterstitialAd = try await RewardedInterstitialAd.load( rewardedInterstitialAd = try await RewardedInterstitialAd.load(
with: AdvManager.REWARDED_INTERSTITIALAD_KEY, request: Request()) with: AdvManager.REWARDED_INTERSTITIALAD_KEY, request: Request())
rewardedInterstitialAd?.fullScreenContentDelegate = self rewardedInterstitialAd?.fullScreenContentDelegate = self
rewardedInterstitialAd?.paidEventHandler = {[weak self] value in
guard let weakSelf = self else { return }
print("激励广告价值回调",value)
let valueMicros = value.value
let currencyCode = value.currencyCode
let precision = value.precision
// 获取基础广告信息
var pram = weakSelf.loadedAdNetworkResponseInfo(ad: weakSelf.rewardedInterstitialAd)
// // 添加价值相关信息到 pram 字典中
pram["valueMicros"] = "\(valueMicros)"
pram["currencyCode"] = currencyCode
pram["precision"] = "\(precision.rawValue)"
print("广告价值和来源", pram)
// 使用 APIReportManager 上报广告价值
APIReportManager().startReport(type: .ad_price, ext: pram)
}
APIReportManager.shared.startReport( APIReportManager.shared.startReport(
type: .ad_pull, type: .ad_pull,
ext: ["ad_type":"rewardAd", ext: ["ad_type":"rewardAd",
...@@ -140,6 +173,26 @@ class AdvManager : NSObject, FullScreenContentDelegate { ...@@ -140,6 +173,26 @@ class AdvManager : NSObject, FullScreenContentDelegate {
interstitial = try await InterstitialAd.load( interstitial = try await InterstitialAd.load(
with: AdvManager.INTERSTITIALAD_KEY, request: Request()) with: AdvManager.INTERSTITIALAD_KEY, request: Request())
interstitial?.fullScreenContentDelegate = self interstitial?.fullScreenContentDelegate = self
interstitial?.paidEventHandler = {[weak self] value in
guard let weakSelf = self else { return }
print("插屏广告价值回调",value)
let valueMicros = value.value
let currencyCode = value.currencyCode
let precision = value.precision
// 获取基础广告信息
var pram = weakSelf.loadedAdNetworkResponseInfo(ad: weakSelf.interstitial)
// // 添加价值相关信息到 pram 字典中
pram["valueMicros"] = "\(valueMicros)"
pram["currencyCode"] = currencyCode
pram["precision"] = "\(precision.rawValue)"
print("广告价值和来源", pram)
// 使用 APIReportManager 上报广告价值
APIReportManager().startReport(type: .ad_price, ext: pram)
}
APIReportManager.shared.startReport( APIReportManager.shared.startReport(
type: .ad_pull, type: .ad_pull,
ext: ["ad_type":"interAd", ext: ["ad_type":"interAd",
...@@ -297,7 +350,7 @@ class AdvManager : NSObject, FullScreenContentDelegate { ...@@ -297,7 +350,7 @@ class AdvManager : NSObject, FullScreenContentDelegate {
extension AdvManager{ extension AdvManager{
func loadedAdNetworkResponseInfo(ad: FullScreenPresentingAd) ->[String:String]{ func loadedAdNetworkResponseInfo(ad: FullScreenPresentingAd?) ->[String:String]{
var adNetworkName = "" var adNetworkName = ""
var adSourceName = "" var adSourceName = ""
...@@ -315,6 +368,7 @@ extension AdvManager{ ...@@ -315,6 +368,7 @@ extension AdvManager{
adSourceInstanceID = rewardedAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceInstanceID ?? "unknown" adSourceInstanceID = rewardedAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceInstanceID ?? "unknown"
} else if let interstitialAd = ad as? InterstitialAd { } else if let interstitialAd = ad as? InterstitialAd {
adNetworkName = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adNetworkClassName ?? "unknown" adNetworkName = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adNetworkClassName ?? "unknown"
adSourceName = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceName ?? "unknown" adSourceName = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceName ?? "unknown"
adSourceID = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceID ?? "unknown" adSourceID = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceID ?? "unknown"
...@@ -323,22 +377,24 @@ extension AdvManager{ ...@@ -323,22 +377,24 @@ extension AdvManager{
adSourceInstanceID = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceInstanceID ?? "unknown" adSourceInstanceID = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceInstanceID ?? "unknown"
} }
var ad_type = "interAd" var pram = [
if let _ = ad as? RewardedInterstitialAd{
ad_type = "rewardAd"
}
let pram = [
"ad_type": ad_type,
"from":currentVCName, "from":currentVCName,
"networkname":adNetworkName, "networkname":adNetworkName,
"source":adSourceName, "adSourceName":adSourceName,
"adSourceInstanceName":adSourceInstanceName, "adSourceInstanceName":adSourceInstanceName,
"adSourceID":adSourceID, "adSourceId":adSourceID,
"adNetworkClassName":adNetworkClassName, "adNetworkClassName":adNetworkClassName,
"adSourceInstanceID":adSourceInstanceID "adSourceInstanceId":adSourceInstanceID,
] ]
if let rewardAd = ad as? RewardedInterstitialAd{
pram["ad_type"] = "rewardAd"
pram["adUnitId"] = rewardAd.adUnitID
}else if let interstitial = ad as? InterstitialAd{
pram["ad_type"] = "interAd"
pram["adUnitId"] = interstitial.adUnitID
}
return pram return pram
} }
} }
......
...@@ -115,7 +115,7 @@ class HomeViewController:BaseViewController { ...@@ -115,7 +115,7 @@ class HomeViewController:BaseViewController {
self.setupUI() self.setupUI()
// 调用下追踪权限 // 调用下追踪权限
// checkTrackingAuthorization() checkTrackingAuthorization()
homeView = HomeView(frame: view.bounds) homeView = HomeView(frame: view.bounds)
homeView?.y = cWindow?.safeAreaInsets.top ?? 20 homeView?.y = cWindow?.safeAreaInsets.top ?? 20
...@@ -251,7 +251,7 @@ class HomeViewController:BaseViewController { ...@@ -251,7 +251,7 @@ class HomeViewController:BaseViewController {
DispatchQueue.main.async { DispatchQueue.main.async {
if !IAPManager.share.showYearPage{ if !IAPManager.share.showYearPage{
HomePayViewController.show { HomePayViewController.show {
NotificationManager().configNotifications() // NotificationManager().configNotifications()
} }
} }
} }
...@@ -291,7 +291,7 @@ class HomeViewController:BaseViewController { ...@@ -291,7 +291,7 @@ class HomeViewController:BaseViewController {
Singleton.shared.startCountdown {} Singleton.shared.startCountdown {}
if !isShowCharge { if !isShowCharge {
NotificationManager().configNotifications() // NotificationManager().configNotifications()
return return
} }
......
...@@ -82,17 +82,17 @@ class HomeView:UIView { ...@@ -82,17 +82,17 @@ class HomeView:UIView {
viewModel.homeDataChanged = {[weak self] section,row in viewModel.homeDataChanged = {[weak self] section,row in
guard let weakSelf = self else { return } guard let weakSelf = self else { return }
DispatchQueue.main.async { DispatchQueue.main.async {
if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeTitleCollectionCell { // if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeTitleCollectionCell {
// 只更新需要改变的内容 // // 只更新需要改变的内容
let model = weakSelf.viewModel.headerGroup[row] // let model = weakSelf.viewModel.headerGroup[row]
cell.reloadUIWithModel(model: model) // cell.reloadUIWithModel(model: model)
} // }
if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeOtherCollectionCell { // if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeOtherCollectionCell {
// 只更新需要改变的内容 // // 只更新需要改变的内容
let model = weakSelf.viewModel.cardGroup[row] // let model = weakSelf.viewModel.cardGroup[row]
cell.reloadUIWithModel(model: model) // cell.reloadUIWithModel(model: model)
} // }
// weakSelf.collectionView.reloadData() weakSelf.collectionView.reloadData()
weakSelf.homeHeader?.progressBar.chaoticProgress = CGFloat(weakSelf.viewModel.totalSize) weakSelf.homeHeader?.progressBar.chaoticProgress = CGFloat(weakSelf.viewModel.totalSize)
weakSelf.reloadHeadSize() weakSelf.reloadHeadSize()
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyDsq1YCrNyDHATVaIk8MkM1zFZNRMERF1E</string>
<key>GCM_SENDER_ID</key>
<string>671559026879</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.app.phonemanager</string>
<key>PROJECT_ID</key>
<string>ai-phone-manager</string>
<key>STORAGE_BUCKET</key>
<string>ai-phone-manager.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:671559026879:ios:3e9d1cac64859ed57d5e0a</string>
</dict>
</plist>
\ No newline at end of file
This diff is collapsed.
...@@ -20,6 +20,9 @@ target 'PhoneManager' do ...@@ -20,6 +20,9 @@ target 'PhoneManager' do
pod 'GoogleAPIClientForREST/Gmail' pod 'GoogleAPIClientForREST/Gmail'
pod 'Adjust', '~> 5.4.0' pod 'Adjust', '~> 5.4.0'
#广告适配器
pod 'GoogleMobileAdsMediationAppLovin'
# pod 'GoogleMobileAdsMediationFacebook'
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment