Facebook App Invites 打开 SafariViewController 而不是 Native app

Facebook App Invites opens SafariViewController instead of Native app

我正在尝试实施来自 Facebook 的 App Invites 功能,我想让我的用户重定向到本地 Facebook 应用程序(如果安装在用户的设备上)。

然而,尽管 Facebook Native 应用程序安装在设备上,但它永远不会打开,'Invite Dialog' 总是在 SafariViewController 中打开(见下图)。这是不受欢迎的,因为大多数时候用户没有登录 Safari 并且会放弃完成 "invite" 任务。

以下是我用来构建应用程序的 SDK 版本:

我已经阅读了 Preparing Your Apps for iOS9 并且已经在我的 Info.plist 中填充了所有可能的 URL 方案:

<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 本机应用程序。

如何让我的应用程序用户使用本机 Facebook 应用程序使用 'App Invite' 对话框?

这似乎是Facebook设计的,显然Facebook选择使用SafariViewController来避免请求多次切换应用程序的权限。您可以查看常见问题 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.