苹果拒绝app 10.6 因为Facebook打开Safari登录

Apple rejected app 10.6 because Facebook opens Safari to login

我发送了另一个版本的应用程序,允许用户通过 Facebook 登录。当然,我用的是官方Facebook iOS SDK。

但是 Apple 两次拒绝了我的应用程序,原因如下:

The app opens a web page in mobile Safari for logging in, then returns the user to the app. The user should be able log in without opening Safari first.

我试图获取更多信息,评论者的回答是:

Thank you for your response. We reviewed your app version 3.2.1 and when the user taps Facebook to login, the user is taken to mobile Safari and then back to the app.

It provides poor user's experience and not in compliance with the Guidelines.

Thank you for your response. It would be appropriate to allow the users to login inside the app without redirecting to mobile Safari.

为什么只有我的应用程序出现此错误,而数十个应用程序使用 Facebook iOS SDK 并没有被拒绝?

Facebook iOS SDK 有没有办法在应用内打开登录页面?

iOS 的 Facebook SDK 提供了各种登录体验,您的应用可以使用这些体验来验证某人的身份。此 link includes all the information you need to know in order to implement Facebook login in your iOS app.Or Check ray wenderlich 教程 Facebook iOS 教程:如何从您的 iPhone 应用程序

使用 Facebook 的新图表 API

现在 Apple 制定了更严格的规则。

您可以在官方 Facebook 文档中找到问题的答案 here

章节"Embedded WebView Login Dialog"

Google+ SDK 也会出现同样的问题,应用可能会因同样的原因被拒绝:

Reasons

10.6: Apple and our customers place a high value on simple, refined, creative, well thought through interfaces. They take more work but are worth it. Apple sets a high bar. If your user interface is complex or less than very good, it may be rejected ----- 10.6 -----

We found the following issue with the user interface of your app:

The app opens a web page in mobile Safari for creating an account or logging in for Google+ account, then returns the user to the app. The user should be able to create an account or log in without opening Safari first.

所以最好的解决方案是通过嵌入式 WebView 移动服务器端 oAuth 2.0,其中 SDK 不允许您自动处理此问题(如 Facebook SDK),至少在这些 SDK 不进行更新之前处理嵌入式 WebView 用例。

Facebook SDK 4.0+

FBSDKLoginManager *login = [FBSDKLoginManager new];
if (![UIApplication.sharedApplication canOpenURL:[NSURL URLWithString:@"fb://"]])
{
  login.loginBehavior = FBSDKLoginBehaviorWeb;
}

它将阻止通过 Safari 打开。