5

I sent another version of my app, that allow users to login via Facebook. Of course, I use official Facebook iOS SDK.

But Apple twice rejected my app with following reason:

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.

I tried to get more info, and reviewer's answer was:

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.

and

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

Why only my app got this error, when dozens of apps using Facebook iOS SDK this way and don't get rejects?

Is there way in Facebook iOS SDK to open login page inside app?

Community
  • 1
  • 1
Vitaly Baev
  • 331
  • 1
  • 3
  • 8
  • are you writing in objective-c or swift and working with the standard Facebook SDK? – jackslash Jan 13 '15 at 09:20
  • You can use the `FBLoginView` to log the user in and avoid kicking him into Mobile Safari – Lefteris Jan 13 '15 at 09:22
  • `Why only my app got this error, when dozens of apps using Facebook iOS SDK this way and don't get rejects?` they certainly get rejected. They just didn't when their developers last updated their app. Guidelines are subject to change. – HAS Jan 13 '15 at 09:26
  • How are you doing login with the SDK? Can you provide some code? – Ming Li Jan 13 '15 at 17:47

4 Answers4

6

Facebook SDK 4.0+

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

It will prevent to open through Safari.

Victor
  • 914
  • 12
  • 15
4

The same issue happens with the Google+ SDK, the app could be rejected for the same reason:

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.

So the best solution is to move the server-side oAuth 2.0 through the Embedded WebView where the SDK does not let you to handle this automatically (like the Facebook SDK), at least until those SDKs does not make an update to handle the Embedded WebView use case.

Community
  • 1
  • 1
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
2

Now Apple made their rules stricter.

You can find answer for your question in official Facebook documentation here.

Chapter "Embedded WebView Login Dialog"

perpetuous
  • 298
  • 2
  • 8
0

The Facebook SDK for iOS provides various login experiences that your app can use to authenticate someone. This link includes all the information you need to know in order to implement Facebook login in your iOS app.Or Check ray wenderlich tutorial Facebook Tutorial for iOS: How To Use Facebook’s New Graph API from your iPhone App

Same7Farouk
  • 837
  • 9
  • 19