地址

1
https://github.com/facebook/facebook-ios-sdk

源码配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fbAPP-ID</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>APP-ID</string>
<key>FacebookClientToken</key>
<string>CLIENT-TOKEN</string>
<key>FacebookDisplayName</key>
<string>APP-NAME</string>
1. 在 `[CFBundleURLSchemes]` 键内的 `<array><string>` 中,将 _APP-ID_ 替换为您的应用编号。
2. 在 `FacebookAppID` 键内的 `<string>` 中,将 _APP-ID_ 替换为您的应用编号。
3. 在 `FacebookClientToken` 键内的 `<string>` 中,将 _CLIENT-TOKEN_ 替换为您在应用面板**设置** > **高级** > **客户端口令**中找到的值。
4. 在 `FacebookDisplayName` 键内的 `<string>` 中,将 _APP-NAME_ 替换为您的应用名称。
5. 如要使用任何可将应用切换至 Facebook 应用的 Facebook 对话框(如登录、分享、应用邀请等),应用程序的 `Info.plist` 还需包含以下代码:

<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbapi20160328</string>
<string>fbauth</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>

 Keychain Sharing 功能,才能使登录功能在 Mac Catalyst 应用程序中正常运作。

触发问题

1
2
Undefined symbol: __swift_FORCE_LOAD_$_swiftDataDetection
引入之后,编译一下,出现100多个报错,看很多报错都带swift字眼,搜了下解决方案,也很简单,新建一个空的Swift文件,重新编译一下就没了,试了下也确实可行,真坑啊,oc的代码,导入一个库,还得加个swift的文件才能编译过