Facebook SDK - FBSession:未提供 AppID
Facebook SDK - FBSession: No AppID provided
我想在我的 iOS 项目中集成 Facebook 登录 SDK。问题是我在启动应用程序时收到此错误消息。
2015-01-08 18:33:06.591 XXXXX[24994:2533100] *** Terminating app due to uncaught exception 'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: No AppID provided; either pass an AppID to init, or add a string valued key with the appropriate id named FacebookAppID to the bundle *.plist'
我已经将此行添加到我的 info.plist
中,但它仍然无法正常工作。
info.list
<key>FacebookAppID</key>
<string><1025024xxxxxxxx></string>
<key>FacebookDisplayName</key>
<string>XXXXXX</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb<1025024xxxxxxxx></string>
</array>
</dict>
</array>
我怀疑它没有检测到我的 Facebook ID。我正在使用 Xcode6.1.
您的项目中有两个同名的 info.plist
文件。 YourProjectTests
的一个文件夹,其中 info.plist
文件和其他 YourProject
也是 info.plist
文件。
两个plist文件:
您必须在 YourProject
info.plist 文件中设置 FacebookAppID
,但不能设置 YourProjectTests
info.plist
发生此错误是因为 YourProjectTests
其中 info.plist
文件设置 FacebookAppID
将您的 FacebookAppID
添加到 info.plist
文件上方,如上图所示。
否则也设置FacebookAppID
如下。
如果您已经在 info.plist 中添加了 App ID 并发生崩溃,请确保您已在 AppDelegate Class didFinishLaunching 选项中添加此单行代码
//Facebook setup
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
我想在我的 iOS 项目中集成 Facebook 登录 SDK。问题是我在启动应用程序时收到此错误消息。
2015-01-08 18:33:06.591 XXXXX[24994:2533100] *** Terminating app due to uncaught exception 'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: No AppID provided; either pass an AppID to init, or add a string valued key with the appropriate id named FacebookAppID to the bundle *.plist'
我已经将此行添加到我的 info.plist
中,但它仍然无法正常工作。
info.list
<key>FacebookAppID</key>
<string><1025024xxxxxxxx></string>
<key>FacebookDisplayName</key>
<string>XXXXXX</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb<1025024xxxxxxxx></string>
</array>
</dict>
</array>
我怀疑它没有检测到我的 Facebook ID。我正在使用 Xcode6.1.
您的项目中有两个同名的 info.plist
文件。 YourProjectTests
的一个文件夹,其中 info.plist
文件和其他 YourProject
也是 info.plist
文件。
两个plist文件:
您必须在 YourProject
info.plist 文件中设置 FacebookAppID
,但不能设置 YourProjectTests
info.plist
发生此错误是因为 YourProjectTests
其中 info.plist
文件设置 FacebookAppID
将您的 FacebookAppID
添加到 info.plist
文件上方,如上图所示。
否则也设置FacebookAppID
如下。
如果您已经在 info.plist 中添加了 App ID 并发生崩溃,请确保您已在 AppDelegate Class didFinishLaunching 选项中添加此单行代码
//Facebook setup
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)