【问题标题】:AppID not Detected未检测到 AppID
【发布时间】:2015-08-12 12:23:05
【问题描述】:

我想在 Swift 中使用 facebook 登录。他们给我错误 AppId not set in Plist 但我在 plist 上设置 AppId。它给出了这个错误:

my2015-08-12 17:49:27.211 swiftcontact[16083:2102678] *** 终止 应用程序由于未捕获的异常“InvalidOperationException”,原因: '未找到应用 ID。使用您的应用 ID 添加一个字符串值作为键 FacebookAppID 到 Info.plist 或调用 [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>

【问题讨论】:

  • 你试过我下面的解决方案了吗?

标签: ios iphone swift


【解决方案1】:

我也遇到过这种情况,我所做的就是在 viewDidLoad 中声明我的应用程序 ID,就像这个 FBSDKSettings.setAppID("your_app_id") 一样。

【讨论】:

    【解决方案2】:

    在我的例子中,我忘记在我的 AppDelegate 中添加 Facebook 的 ApplicationDelegate 方法

    ApplicationDelegate.shared.application(_:, didFinishLaunchingWithOptions:)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-07
      • 2018-12-11
      • 2019-11-25
      • 2016-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多