我想用Swift登录facebook。它们给了我错误的AppId,没有在plist中设置,但是我在Plist上设置了AppId。它给出了这个错误:
or 2015-08-12 17:49:27.211 SpetContCont16083:2102678*由于非正常异常'InvalidOperationException',原因:“找不到应用ID。为FacebookAppID键添加一个字符串值,或调用FBSDKSettings setAppID:。”
这些是我的plist文件的内容:
<dict>
<key>FacebookAppID</key>
<string>9023XXXXXXXXXXX</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.varun.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>FacebookDisplayName</key>
<string>BOOMaGIFT</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb9023XXXXXXXXXXX</string>
</array>
<key>CFBundleURLName</key>
<string></string>
</dict>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
</dict>
</plist>发布于 2016-02-02 02:17:30
我也遇到了这种情况,我所做的就是在viewDidLoad中声明我的应用程序id,就像这个FBSDKSettings.setAppID("your_app_id")一样。
发布于 2021-05-04 18:50:54
在我的例子中,我忘记在我的ApplicationDelegate中添加Facebook的ApplicationDelegate方法
ApplicationDelegate.shared.application(_:, didFinishLaunchingWithOptions:)https://stackoverflow.com/questions/31965115
复制相似问题