Commit 9779b105 authored by shenyong's avatar shenyong

Merge branch 'dev_syong' into dev_main

# Conflicts:
#	PhoneManager.xcworkspace/xcshareddata/swiftpm/Package.resolved
parents ee2451e0 f78d0c53
......@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
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 */; };
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, ); }; };
......@@ -210,8 +212,10 @@
04C299E22DDE02530054D76C /* AdSupport.framework in Frameworks */,
042EF7462DD4A3F90028DE2C /* Kingfisher in Frameworks */,
3A00E856852A8783E544CD7D /* Pods_PhoneManager.framework in Frameworks */,
046463852DDF5A48008C852D /* FirebaseCore in Frameworks */,
04CA06622DDDB40E009A15E3 /* KeychainSwift in Frameworks */,
04EC294B2DD33B480049739A /* GoogleSignIn in Frameworks */,
046463832DDF5A48008C852D /* FirebaseAnalytics in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -402,6 +406,7 @@
04EC26182DD33B070049739A /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */,
042EF7442DD4A3780028DE2C /* XCRemoteSwiftPackageReference "Kingfisher" */,
04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */,
046463812DDF5A1F008C852D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = EB388E5C2D8A61A800629B0D /* Products */;
......@@ -1027,6 +1032,14 @@
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" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/evgenyneu/keychain-swift.git";
......@@ -1051,6 +1064,16 @@
package = 042EF7442DD4A3780028DE2C /* XCRemoteSwiftPackageReference "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 */ = {
isa = XCSwiftPackageProductDependency;
package = 04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */;
......
{
"originHash" : "9715bfe86725a7948ccb1e23cd4c1f1a8959cce77c1a2b3dba6a39cbdffc06cd",
"originHash" : "adb191961c40e5f91d7183a69d699ffc93b7484a9bff6bcd805acc4dafe394ba",
"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",
"kind" : "remoteSourceControl",
......@@ -19,6 +28,33 @@
"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",
"kind" : "remoteSourceControl",
......@@ -37,6 +73,15 @@
"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",
"kind" : "remoteSourceControl",
......@@ -55,6 +100,15 @@
"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",
"kind" : "remoteSourceControl",
......@@ -73,6 +127,24 @@
"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",
"kind" : "remoteSourceControl",
......@@ -81,6 +153,15 @@
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"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
......
......@@ -12,7 +12,7 @@ import GoogleMobileAds
import UserMessagingPlatform
import GoogleSignIn
import AdjustSdk
import FirebaseCore
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
......@@ -40,6 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
widgetAppgourp.share.PushWidgetData(battery: Int(battery), storage: Int(storage))
//初始化adjust
let yourAppToken = "6mouvwgw7ksg"
......@@ -68,6 +69,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// 初始化广告SDK
AdvManager.shared.initAdertisementSDK()
FirebaseApp.configure()
PMEmailManager.shareManager.restore()
SettingConfiguration.share.initData()
HapticManager.share.setupHapticEngine()
......@@ -79,26 +81,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
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 = [
// "trackerToken":attribution?.trackerToken ?? "",
// "trackerName":attribution?.trackerName ?? "",
// "tracker_token":attribution?.trackerToken ?? "",
// "tracker_name":attribution?.trackerName ?? "",
// "network":attribution?.network ?? "",
// "campaign":attribution?.campaign ?? "",
// "adgroup":attribution?.adgroup ?? "",
// "creative":attribution?.creative ?? "",
// "clickLabel":attribution?.clickLabel ?? "",
// "costType":attribution?.costType ?? "",
// "costAmount":attribution?.costAmount ?? "",
// "costCurrency":attribution?.costCurrency ?? "",
// "click_label":attribution?.clickLabel ?? "",
// "cost_type":attribution?.costType ?? "",
// "cost_amount":attribution?.costAmount ?? "",
// "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()
......@@ -223,7 +225,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
return GIDSignIn.sharedInstance.handle(url)
}
}
func convertToSwiftDictionary(_ nsDict: NSDictionary) -> [String: Any] {
return nsDict as? [String: Any] ?? [:]
}
}
......@@ -62,8 +62,11 @@ extension AppDelegate:AdjustDelegate{
func adjustAttributionChanged(_ attribution: ADJAttribution?) {
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 {
// 是否热启动
var isHotLaunch:Bool = false
// 订阅状态
var subscriptionType:SubscriptionType = .none{
didSet{
isSubscribed = subscriptionType != .none
}
}
var subscriptionType:SubscriptionType = .none
func config(){}
......
......@@ -10,6 +10,7 @@ import GoogleMobileAds
import UserMessagingPlatform
import AppTrackingTransparency
import AdSupport
import AppLovinSDK
enum AdvertisementType {
case rewardedInterstitialType
......@@ -20,8 +21,8 @@ enum AdvertisementType {
class AdvManager : NSObject, FullScreenContentDelegate {
// fixme:上线前更改
// 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 REWARDED_INTERSTITIALAD_KEY : String = "ca-app-pub-3480207748580737/4276457203"
// private static let INTERSTITIALAD_KEY : String = "ca-app-pub-3480207748580737/5836950888"
// info.plist: ca-app-pub-3480207748580737~4236262472
private static let REWARDED_INTERSTITIALAD_KEY : String = "ca-app-pub-3940256099942544/6978759866"
......@@ -94,14 +95,26 @@ class AdvManager : NSObject, FullScreenContentDelegate {
/// 初始化SDK
func initAdertisementSDK() {
// Initialize the Google Mobile Ads SDK.
MobileAds.shared.start()
// Request an ad.
Task {
// 同时load两个广告内容
await self.loadInterstitial()
await self.loadRewardedInterstitialAd()
ALPrivacySettings.setDoNotSell(true)
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 {
// 同时load两个广告内容
await self.loadInterstitial()
await self.loadRewardedInterstitialAd()
}
// 隐私设置
ALPrivacySettings.setHasUserConsent(true)
}
}
/// 获取激励插页广告
......@@ -112,6 +125,26 @@ class AdvManager : NSObject, FullScreenContentDelegate {
rewardedInterstitialAd = try await RewardedInterstitialAd.load(
with: AdvManager.REWARDED_INTERSTITIALAD_KEY, request: Request())
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(
type: .ad_pull,
ext: ["ad_type":"rewardAd",
......@@ -140,6 +173,26 @@ class AdvManager : NSObject, FullScreenContentDelegate {
interstitial = try await InterstitialAd.load(
with: AdvManager.INTERSTITIALAD_KEY, request: Request())
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(
type: .ad_pull,
ext: ["ad_type":"interAd",
......@@ -297,8 +350,8 @@ class AdvManager : NSObject, FullScreenContentDelegate {
extension AdvManager{
func loadedAdNetworkResponseInfo(ad: FullScreenPresentingAd) ->[String:String]{
func loadedAdNetworkResponseInfo(ad: FullScreenPresentingAd?) ->[String:String]{
var adNetworkName = ""
var adSourceName = ""
var adSourceID = ""
......@@ -315,6 +368,7 @@ extension AdvManager{
adSourceInstanceID = rewardedAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceInstanceID ?? "unknown"
} else if let interstitialAd = ad as? InterstitialAd {
adNetworkName = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adNetworkClassName ?? "unknown"
adSourceName = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceName ?? "unknown"
adSourceID = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceID ?? "unknown"
......@@ -323,22 +377,24 @@ extension AdvManager{
adSourceInstanceID = interstitialAd.responseInfo.loadedAdNetworkResponseInfo?.adSourceInstanceID ?? "unknown"
}
var ad_type = "interAd"
if let _ = ad as? RewardedInterstitialAd{
ad_type = "rewardAd"
}
let pram = [
"ad_type": ad_type,
var pram = [
"from":currentVCName,
"networkname":adNetworkName,
"source":adSourceName,
"adSourceName":adSourceName,
"adSourceInstanceName":adSourceInstanceName,
"adSourceID":adSourceID,
"adSourceId":adSourceID,
"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
}
}
......
......@@ -251,7 +251,7 @@ class HomeViewController:BaseViewController {
DispatchQueue.main.async {
if !IAPManager.share.showYearPage{
HomePayViewController.show {
NotificationManager().configNotifications()
// NotificationManager().configNotifications()
}
}
}
......@@ -291,7 +291,7 @@ class HomeViewController:BaseViewController {
Singleton.shared.startCountdown {}
if !isShowCharge {
NotificationManager().configNotifications()
// NotificationManager().configNotifications()
return
}
......
......@@ -82,17 +82,17 @@ class HomeView:UIView {
viewModel.homeDataChanged = {[weak self] section,row in
guard let weakSelf = self else { return }
DispatchQueue.main.async {
if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeTitleCollectionCell {
// 只更新需要改变的内容
let model = weakSelf.viewModel.headerGroup[row]
cell.reloadUIWithModel(model: model)
}
if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeOtherCollectionCell {
// 只更新需要改变的内容
let model = weakSelf.viewModel.cardGroup[row]
cell.reloadUIWithModel(model: model)
}
// weakSelf.collectionView.reloadData()
// if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeTitleCollectionCell {
// // 只更新需要改变的内容
// let model = weakSelf.viewModel.headerGroup[row]
// cell.reloadUIWithModel(model: model)
// }
// if let cell = weakSelf.collectionView.cellForItem(at: IndexPath(row: row, section: section)) as? HomeOtherCollectionCell {
// // 只更新需要改变的内容
// let model = weakSelf.viewModel.cardGroup[row]
// cell.reloadUIWithModel(model: model)
// }
weakSelf.collectionView.reloadData()
weakSelf.homeHeader?.progressBar.chaoticProgress = CGFloat(weakSelf.viewModel.totalSize)
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
pod 'GoogleAPIClientForREST/Gmail'
pod 'Adjust', '~> 5.4.0'
#广告适配器
pod 'GoogleMobileAdsMediationAppLovin'
# pod 'GoogleMobileAdsMediationFacebook'
post_install do |installer|
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