Facebook SDK - FBSession:未提供AppID;

Moh*_*din 12 facebook ios swift xcode6

我想在我的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'
Run Code Online (Sandbox Code Playgroud)

我已将此行包含在我的info.plist中,但仍无法正常工作.

info.list

<key>FacebookAppID</key>
    <string>&lt;1025024xxxxxxxx&gt;</string>
    <key>FacebookDisplayName</key>
    <string>XXXXXX</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb&lt;1025024xxxxxxxx&gt;</string>
            </array>
        </dict>
    </array>
Run Code Online (Sandbox Code Playgroud)

我怀疑它没有检测到我的脸书ID.我正在使用xcode6.1.请指教.

Kir*_*odi 28

项目中有两个info.plist同名文件.一个文件夹YourProjectTests,其中info.plist文件和其他文件YourProject也是info.plist.

两个plist文件:

在此输入图像描述

你必须设置你FacebookAppIDYourProjectInfo.plist文件,但不能设置YourProjectTests的info.plist

由于YourProjectTests在哪个info.plist文件设置中发生此错误 FacebookAppID

添加您的FacebookAppIDinabove info.plist文件,如上图所示.

否则设置FacebookAppID如下.

在此输入图像描述