Apple rejected app 10.6 because Facebook opens Safari to login - ios

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?

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.

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.

Now Apple made their rules stricter.
You can find answer for your question in official Facebook documentation here.
Chapter "Embedded WebView Login Dialog"

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

Related

iOS App Store rejection due to WeChat login requiring app installation; possible to use Web view to log in to WeChat on mobile?

An app that I recently submitted to the Apple App Store was rejected, due to the following reason: If the WeChat app is not installed and the user clicks a button "Login with WeChat", a dialog pops up telling the user they must install the WeChat app to log in with it. (if the app is installed, the user is bumped over to the WeChat app to finish login)
Apple suggested that we instead use a Web View to log the user in via WeChat, however the WeChat guide for mobile login states that mobile apps must log in through the WeChat app:
http://open.wechat.com/cgi-bin/newreadtemplate?t=overseas_open/docs/mobile/login/guide
I'm a little confused here because a previous app I had submitted was approved using this setup. In the app I'm currently trying to submit, the user is able to skip WeChat login if they wish, so WeChat installation is not required to use the app. However, it would be nice to be able to tell the user that WeChat is a login option, and that they need to install the WeChat app if they'd like to use it as a login option.
Does anyone know if it's allowable and/or possible (wrt WeChat's system) for an iOS app to log a user in via WeChat using a Web View? It seems that telling the user that WeChat is an available login option might not be possible otherwise...
To answer your question, We don't have any other Webview options to login with Wechat. (as of dated Jan 2018)
I had the same rejection from Apple some time back. After a lot of front and back questions and answers with Apple team, We finally hide the button to login with Wechat when Wechat App is not installed and the review passed. Most of the Chinese apps following the same method AFAIK.
Wechat iOS framework does provide an option to check app installed or not.
+ (BOOL)isWechatAppInstalled;
From the following code, you can check whether the Wechat app is installed in yours phone or not
if WXApi.isWXAppInstalled() {
print("Wechat app is installed")
} else {
print("Wechat app is not installed")
}

TwitterKit 3.0 and TWTRLoginMethod

So TwitterKit updated to 3.0 and TWTRLoginMethod / Twitter accounts registered in iOS settings seems to be gone. Are there any news about this, anywhere? It looks like the only option is to use web/Twitter app login, which is a clear step down in UX.
Update 1: Ok, there is a changelog. It seems usage of accounts in iOS settings is not supported anymore. This is really really bad. We might have to consider to not use Twitter for login because of this.
Update 2: So with iOS 11 Twitter/Facebook/etc accounts are gone from iOS settings app. That obviously makes the real reason behind this change.
3.0.0: May 25, 2017 Added support for OAuth via the Twitter for iOS mobile app in -[Twitter loginWithCompletion:] and TWTRLogInButton
Update TWTRComposerViewController to handle full compose functionality
including image and video attachments Added result_type to
TWTRSearchTimelineDataSource. Removed boolean property topTweetsOnly
Removed TWTRLoginMethod in Twitter Added sending methods:
-[TWTRAPIClient sendTweetWithText:completion:] Changed TWTRComposer to present TWTRComposerViewController instead built-in iOS composer
Deprecated support for Card Removed TWTRComposerTheme Deprecated
TWTRComposer
Twitter Kit no longer supports using system accounts directly.
The new Twitter App login will allow users to seamlessly use any session from their mobile Twitter app, and the SFSafariViewController based login will allow users to use logged-in sessions from Mobile Safari. These log in flows also allow users to view permissions that the app is requesting.

Google Plus login Apple now rejecting flip to Safari

I have an app on the App Store (search for MTHS) that uses Google+ login.
The login feature was accepted in Aug 2014.
I submitted a bug fix in Dec 2014, and Apple rejected it for "flipping over to Safari to login":
We found the following issues with the user interface of your app:
The app opens a web page in mobile Safari for creating an account or logging in, then returns the user to the app. The user should be able to create an account or log in without opening Safari first.
Is there a way to implement Google+ login and not have the flip to Safari?
I have seen it in other apps.
The Google has released the latest Sign In SDK which resolves this problem.
Google Sign In SDK 2.0 is documented on the new dev site :
https://developers.google.com/identity/sign-in/ios/
Hope this helps..
Your app should be accepted if you notify the user first that the action will take them out of the app. A simple UIAlertView with a cancel and ok that continues with the Google+ login should work. An app we have does something similar and it was accepted after adding an alert.
Edit: Apple will reject any app that shifts to another app (e.g. launching another app like safari) without first notifying the user and giving them a choice with a label such as "This action will take you out of the app, continue?". In regards to this question, #Learner has the correct solution. At time of original answer, the new SDK wasn't yet available.

How do I use Facebook Login via Facebook App for iOS

I have a little problem. I am sing Facebook's API to get users information. I am using the code that provide here: https://github.com/pedro1993/ios-howtos
In those examples, when somebody logs in with Facebook they are taken to the Facebook app, whereas when in my app, Facebook is opened in a UIWebView. How can I stop that from happening and use the Facebook app?
Here is an example:
Peter
Follow this official tutorial instead https://developers.facebook.com/docs/facebook-login/ios/v2.0
Update Facebook SDK has several fallback behaviors to try before it falls back to in-app web view. You can debug it by setting breakpoints in corresponding places in code. From the look of it https://github.com/facebook/facebook-ios-sdk/blob/296771f5ed7674fcbed9c31cf39bf9c8e4706403/src/Login/FBSession.m#L1039 seems like a good place to start.
Especially try to debug -[FBSessionAppSwitchingLoginStategy tryPerformAuthorizeWithParams:session:logger:.

Facebook access token in iOS

Which is the right approach to get access token for Facebook in iOS app?
Using Facebook app
Using safari
USing inline dialog
In case you are using the Facebook api for iOS you need only ask it to authorize. It will actually check if your device support multitasking. If so, it will first try to use Facebook app. If it will fall(as the app might be not installed on that device after all), it will proceed to safari. And if you are on non-multitasking device it will open an inline dialog popup.Just use the last version and that's it!
I think better will be to use UIWebView or ASIHTTPRequest
it's done automatically
it used to be that facebook authentication would always open a uiwebview to opt the user to enter his credentials.
But now - if your ios version supports multitasking - it will open the facebook app or safari if possible and ask for authorization and then redirect back to your application. for more information you should refer to the sample application of the facebook sdk.
So it will try 1 then 2 and then fallback to 3
https://github.com/facebook/facebook-ios-sdk

Resources