我想将 Facebook 事件跟踪添加到我的应用程序中,但看来 Facebook SDK 文档 仅提供 Swift 语言的代码:
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ApplicationDelegate.shared.application(
application,
didFinishLaunchingWithOptions: launchOptions
)
return true
}
正如我所读,我应该使用 FBSDKApplicationDelegate 但我不知道如何使用。
谢谢
初始化FBSDK
[FBSDKApplicationDelegate.sharedInstance application:application didFinishLaunchingWithOptions:launchOptions];
添加
#import <AuthenticationServices/AuthenticationServices.h>
#import <SafariServices/SafariServices.h>
#import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>
您的进口声明和
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
到
didFinishLaunchingWithOptions
感谢react-native-fbsdk-next包提供此信息(https://www.npmjs.com/package/react-native-fbsdk-next#32-ios)