baxi hace 6 días
padre
commit
9abf232afb
Se han modificado 2 ficheros con 5 adiciones y 0 borrados
  1. 2 0
      native/engine/ios/FACEBOOK.md
  2. 3 0
      native/engine/ios/service/FBWrapper.mm

+ 2 - 0
native/engine/ios/FACEBOOK.md

@@ -26,6 +26,8 @@ AppDelegate 直接持有 FBWrapper 单例,无需在 service.json 再次注册
 ## Objective-C++ 找不到 Facebook 类型
 
 FBWrapper.mm 需要同时导入 CoreKit、LoginKit、ShareKit 的普通头文件和对应的 `模块名-Swift.h`。
+在这些 Facebook 头文件之前导入 `SafariServices/SafariServices.h` 和 `AuthenticationServices/AuthenticationServices.h`,
+以提供 `SFSafariViewControllerDelegate` 和 `ASWebAuthenticationPresentationContextProviding` 的完整协议声明;不要修改 Pods 中生成的头文件。
 SDK 中 Swift 实现的登录类、分享协议通过这些生成头文件暴露给 Objective-C++。
 若出现 `Unknown type name FBSDKLoginManager` 或找不到 `FBSDKSharingDelegate`,先确认这些导入已同步到 Mac。
 仅修改 .mm 导入后无需重新安装 Pods;在 Xcode 执行 Product → Clean Build Folder 后重新 Build。

+ 3 - 0
native/engine/ios/service/FBWrapper.mm

@@ -1,4 +1,7 @@
 #import "FBWrapper.h"
+// Swift-generated headers need these protocol definitions when compiled as Objective-C++.
+#import <SafariServices/SafariServices.h>
+#import <AuthenticationServices/AuthenticationServices.h>
 #import <FBSDKCoreKit/FBSDKCoreKit.h>
 #import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>
 #import <FBSDKLoginKit/FBSDKLoginKit.h>