优化fb日志上报

This commit is contained in:
zhl 2023-03-22 19:28:12 +08:00
parent d79882f6af
commit 23f6445726
9 changed files with 68 additions and 14 deletions

View File

@ -33,7 +33,7 @@
#include <unistd.h>
#include <sys/sysctl.h>
#import <TikTokOpenSDK/TikTokOpenSDKApplicationDelegate.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
@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;
}

View File

@ -10,7 +10,7 @@
#import "UIViewController+Logger.h"
#import <Foundation/Foundation.h>
#import "NSString+Customer.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
@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];
}

View File

@ -7,7 +7,7 @@
#include <string>
#import "UIViewController+Share.h"
#import <FBSDKShareKit/FBSDKShareKit.h>
@import FBSDKShareKit;
@implementation UIViewController (Share)

View File

@ -17,9 +17,8 @@
#import "NSString+Customer.h"
#import "NSData+Base64.h"
#import "AppleSignIn.h"
#import <FBSDKLoginKit/FBSDKLoginKit.h>
@import FBSDKLoginKit;
@import GoogleSignIn;
static NSString * const kClientID =

View File

@ -62,7 +62,7 @@
<key>FacebookAutoLogAppEventsEnabled</key>
<true/>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<false/>
<true/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>

View File

@ -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'

View File

@ -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">
</BreakpointContent>
@ -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">
</BreakpointContent>
@ -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">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "60486E7D-44D6-4425-917D-BA6C5FEB4D22"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Classes_cocos/UIViewController+Wallet.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "193"
endingLineNumber = "193"
landmarkName = "-showPage:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "DB21E235-4B65-46EF-8B7D-A2478DF2AF6E"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Classes_cocos/UIViewController+Logger.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
landmarkName = "-logEvent:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "972534CF-6961-4EBA-A8F7-0A0C0DBA257C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Classes_cocos/UIViewController+Logger.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "41"
endingLineNumber = "41"
landmarkName = "-logEvent:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -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 });