我正在尝试实现 App Invites来自 Facebook 的功能,我想让我的用户重定向到本地 Facebook 应用程序(如果安装在用户的设备上)。
然而,尽管 Facebook Native 应用程序安装在设备上,但它永远不会打开,“邀请对话框”总是在 SafariViewController
中打开。相反(见下图)。这是不受欢迎的,因为大多数时候用户没有登录 Safari 并且会放弃完成“邀请”任务。
以下是我用来构建应用的 SDK 版本:
- iOS:9.0
- Facebook iOS SDK:4.6.0
- Facebook Unity SDK:7.1.0
我读过 Preparing Your Apps for iOS9并且已经使用所有可能的 URL 方案填充了我的 Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string></string>
<string>http</string>
<string>https</string>
<string>mailto</string>
<string>fb</string>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</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>fbauth</string>
<string>fb-messenger-api20140430</string>
<string>fb-messenger-platform-20150128</string>
<string>fb-messenger-platform-20150218</string>
<string>fb-messenger-platform-20150305</string>
</array>
尽管如此,SafariViewController
始终打开,而不是 Facebook native 应用程序。
如何让我的应用用户使用原生 Facebook 应用使用“应用邀请”对话框?
最佳答案
这似乎是 Facebook 设计的,显然 Facebook 选择使用 SafariViewController 以避免请求多次切换应用程序的权限。可以查看FAQ here
FAQ
Why do I see a ' wants to open Facebook' alert dialog when invoking a dialog?
In iOS 9, the app switches can prompt the user with a confirmation dialog. The SDK will try to minimize the frequency of this by choosing the best dialog available (such as SafariViewController), but this is by design in iOS 9.
关于ios - Facebook App Invites 打开 SafariViewController 而不是 Native app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32914014/