diff --git a/Classes/UnityAppController.mm b/Classes/UnityAppController.mm index f4e4125..9c36689 100644 --- a/Classes/UnityAppController.mm +++ b/Classes/UnityAppController.mm @@ -33,7 +33,7 @@ #include #include #import -#import +@import FBSDKCoreKit; @import FirebaseCore; // we assume that app delegate is never changed and we can cache it, instead of re-query UIApplication every time @@ -399,6 +399,9 @@ extern "C" void UnityCleanupTrampoline() [[TikTokOpenSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; + if (@available(iOS 14.0, *)) { + [[FBSDKSettings sharedSettings] setIsAdvertiserTrackingEnabled:TRUE]; + } [FIRApp configure]; return YES; } @@ -455,6 +458,7 @@ extern "C" void UnityCleanupTrampoline() _startUnityScheduled = true; [self performSelector: @selector(startUnity:) withObject: application afterDelay: 0]; } + [[FBSDKAppEvents shared] activateApp]; _didResignActive = false; } diff --git a/Classes_cocos/UIViewController+Logger.mm b/Classes_cocos/UIViewController+Logger.mm index 86ce660..0dcde4b 100644 --- a/Classes_cocos/UIViewController+Logger.mm +++ b/Classes_cocos/UIViewController+Logger.mm @@ -10,7 +10,7 @@ #import "UIViewController+Logger.h" #import #import "NSString+Customer.h" -#import +@import FBSDKCoreKit; @import FirebaseAnalytics; @implementation UIViewController (Logger) @@ -42,6 +42,8 @@ if ([NSString isStringEmpty:name]) { name = @"custom_event"; } +// NSLog(@"FacebookAdvertiserIDCollectionEnabled: %@", [[FBSDKSettings sharedSettings] isAdvertiserIDCollectionEnabled] ? @"TRUE" : @"FALSE" ); +// NSLog(@"FacebookAdvertiserTrackingEnabled: %@", [[FBSDKSettings sharedSettings] isAdvertiserTrackingEnabled] ? @"TRUE" : @"FALSE" ); [FIRAnalytics logEventWithName: name parameters: jsonDict]; [[FBSDKAppEvents shared] logEvent: name parameters: jsonDict]; } diff --git a/Classes_cocos/UIViewController+Share.mm b/Classes_cocos/UIViewController+Share.mm index a52eb58..935bf4d 100644 --- a/Classes_cocos/UIViewController+Share.mm +++ b/Classes_cocos/UIViewController+Share.mm @@ -7,7 +7,7 @@ #include #import "UIViewController+Share.h" -#import +@import FBSDKShareKit; @implementation UIViewController (Share) diff --git a/Classes_cocos/UIViewController+Wallet.mm b/Classes_cocos/UIViewController+Wallet.mm index 20d942e..7b824cb 100644 --- a/Classes_cocos/UIViewController+Wallet.mm +++ b/Classes_cocos/UIViewController+Wallet.mm @@ -17,9 +17,8 @@ #import "NSString+Customer.h" #import "NSData+Base64.h" #import "AppleSignIn.h" -#import - +@import FBSDKLoginKit; @import GoogleSignIn; static NSString * const kClientID = diff --git a/Info.plist b/Info.plist index 2fa633e..3cfe086 100644 --- a/Info.plist +++ b/Info.plist @@ -62,7 +62,7 @@ FacebookAutoLogAppEventsEnabled FacebookAdvertiserIDCollectionEnabled - + LSApplicationQueriesSchemes fbapi diff --git a/Podfile b/Podfile index e5e8e42..3f83fcc 100644 --- a/Podfile +++ b/Podfile @@ -4,6 +4,7 @@ use_frameworks! target 'Unity-iPhone' do pod 'GoogleSignIn', :path => '/Users/zhl/Downloads/sourcecode/google/GoogleSignIn-iOS/' pod 'TikTokOpenSDK', '~> 5.0.14' + pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'FBSDKShareKit' pod 'FirebaseAnalytics' diff --git a/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/UserInterfaceState.xcuserstate b/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/UserInterfaceState.xcuserstate index ad0a703..562722b 100644 Binary files a/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/UserInterfaceState.xcuserstate and b/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index b9c3cfd..b2c6826 100644 --- a/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Unity-iPhone.xcworkspace/xcuserdata/zhl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -78,8 +78,8 @@ filePath = "Classes_cocos/UIViewController+Wallet.mm" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "175" - endingLineNumber = "175" + startingLineNumber = "174" + endingLineNumber = "174" landmarkName = "-nativeCb:hasErr:dataStr:" landmarkType = "7"> @@ -206,8 +206,8 @@ filePath = "Classes_cocos/UIViewController+Logger.mm" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "45" - endingLineNumber = "45" + startingLineNumber = "47" + endingLineNumber = "47" landmarkName = "-logEvent:" landmarkType = "7"> @@ -222,11 +222,59 @@ filePath = "Classes/UnityAppController.mm" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "402" - endingLineNumber = "402" + startingLineNumber = "405" + endingLineNumber = "405" landmarkName = "-application:didFinishLaunchingWithOptions:" landmarkType = "7"> + + + + + + + + + + + + diff --git a/js/main.js b/js/main.js index be21bbc..f19194d 100644 --- a/js/main.js +++ b/js/main.js @@ -216,8 +216,8 @@ function showQRCode(funId, content) { function showWebPage(funId, url) { try { -// jsb.showWebPage(funId, url); - jsb.openURL(url); + jsb.showWebPage(funId, url); +// jsb.openURL(url); return JSON.stringify({ errcode: 0, data: 1 }); } catch (err) { return JSON.stringify({ errcode: 1, errmsg: err });