【问题标题】:Facebook App Invite not workingFacebook 应用程序邀请不起作用
【发布时间】:2017-09-10 18:11:06
【问题描述】:

我正在尝试像这样添加 facebook App Invite:

let content:FBSDKAppInviteContent = FBSDKAppInviteContent()
        content.appLinkURL = URL(string: "https://fb.me/...")
        content.appInvitePreviewImageURL = URL(string: "http://...")

        let dialog = FBSDKAppInviteDialog()
        dialog.content = content
        dialog.delegate = self
        dialog.fromViewController = self
        dialog.show()

相关的Info.plist键:

<key>FacebookAppID</key>
<string>...</string>
<key>FacebookDisplayName</key>
<string>Blanket</string>
<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>fbauth2</string>
    <string>fb-messenger-api20140430</string>
    <string>fb-messenger-platform-20150128</string>
    <string>fb-messenger-platform-20150218</string>
    <string>fb-messenger-platform-20150305</string>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
</array>

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>com.my.app</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb...</string>
            <string>myappscheme</string>
        </array>
    </dict>
</array>

当我运行代码时,Safari 窗口会打开,并在显示加载微调器后关闭。

返回此错误:

"Error: Optional(Error Domain=com.facebook.sdk.core Code=2 \"(null)\" UserInfo={com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Invalid method_results., com.facebook.sdk:FBSDKErrorArgumentNameKey=method_results})"

设备上安装了 Facebook 应用,并在 facebook 应用中打开分享对话框。

当我尝试调试时,[FBSDKApplicationDelegate _handleBridgeAPIResponseURL:sourceApplication:] 中的响应 URL 是 fb...://bridge/appinvites?version=web&amp;bridge_args=%7B%22app_name%22%3A%22...%22%2C%22action_id%22%3A%...%22%7D&amp;error=%7B%22error%22%3A%22server_error%22%2C%22error_description%22%3A%22Error%20retrieving%20application%20configuration.%22%7D

相关错误:

{"error":"server_error","error_description":"Error retrieving application configuration."}

我不确定这个错误是什么意思,是 Facebook 应用程序配置错误,还是 iOS 应用程序。

相同的邀请适用于 Android,iOS 应用已发布,并且配置了有效的 iTunes URL。

【问题讨论】:

标签: ios iphone facebook facebook-ios-sdk


【解决方案1】:

我可以根据上面的代码邀请朋友,所以请检查 facebook app id 并查看它是否输入正确。并查看是否在 p 列表中提供了正确的 url 标识符和 url 方案。

【讨论】:

    【解决方案2】:

    你可以试试看它是否在 wifi 中工作。 facebook App Invite 中似乎存在一个错误,该错误不适用于移动数据,但在使用 wifi 时有效(出现与上述相同的错误。)

    https://developers.facebook.com/bugs/798217780334522/

    如果它在 wifi 中工作而不在移动数据中工作,请通过上面的链接报告以解决它。

    【讨论】:

    • Facebook 团队已确认的错误正在尝试修复。可以从链接中看到。
    猜你喜欢
    • 1970-01-01
    • 2015-09-18
    • 2015-09-29
    • 1970-01-01
    • 2013-04-14
    • 2013-02-26
    • 1970-01-01
    • 1970-01-01
    • 2015-07-29
    相关资源
    最近更新 更多