FBSDKAppInviteDialog始终启动浏览器

时间:2015-09-28 15:39:05

标签: ios facebook swift facebook-ios-sdk

我需要在我的应用中发送应用邀请,并希望使用本机iOS Facebook应用(如果已安装)。

我在安装了原生Facebook应用程序的iOS 9.0.1的iPhone上运行它,但是对话框始终启动浏览器。它只是没有启动Facebook应用程序。

这是我的代码:

let appLinkUrl:NSURL = NSURL(string: "https://fb.me/xxx")!

var inviteContent:FBSDKAppInviteContent = FBSDKAppInviteContent()
inviteContent.appLinkURL = appLinkUrl

FBSDKAppInviteDialog.showFromViewController(self, withContent: inviteContent, delegate: self)

我的info.plist看起来像这样

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fbxxx</string>
        </array>
    </dict>
</array>

<key>FacebookAppID</key>
<string>xxx</string>
<key>FacebookDisplayName</key>
<string>xxx</string>

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
</array>

另外还有快速入门指南中的所有NSAppTransportSecurity相关条目。

1 个答案:

答案 0 :(得分:0)

根据iOS 9,链接应该在Safari浏览器中打开。这里是以下链接,

https://developers.facebook.com/bugs/786729821439894/?search_id