Twitter Login doesn't present the iOS 9 Safari View Controller

Hello!
Our app uses Facebook, Google+ and Twitter login.
Facebook and Google+ logins open a Safari View Controller and Twitter login opens the Safari app.
We submitted the app to the AppStore and it got rejected, with the following message:
"We noticed that the user is taken to Safari to sign in or register for an account, which provides a poor user experience.

  • Specifically, the app launches out to safari when the user attempts to register with the Twitter account
    Next Steps
    Please revise your app to enable users to sign in or register for an account in the app.
    We recommend implementing the Safari View Controller API to display web content within your app. The Safari View Controller allows the display of a URL and inspection of the certificate from an embedded browser in an app so that customers can verify the webpage URL and SSL certificate to confirm they are entering their sign in credentials into a legitimate page. " .
    What solution can we approach in order to present a Safari View Controller (instead of the Safari app) when we perform a Twitter login?
    Have a good day.

Hi Isabela,

We’ve created an internal task to investigate this. For reference, the task ID is BKNDLSS-12918.

Isabella, check our sample project (in attachment). It was created with latest Backendless SDK (3.0.30 release) and demonstrates, that easyTwitterLogin works via Safari View Controller:

http://support.backendless.com/public/attachments/8cfc23915d8fe85453465934113b2fe0.png</img>

TestEasyTwitterLogin.zip (19.54MB)

Here I found the latest SDK for Backendless? https://backendless.com/mobile-developers/

Because I downloaded that version, I made the change in the Info.plist to URLSchemes, and the login with Twitter is still not with Safari View Controller…

Link on the site yet is not updated, we will fix it asap.
Please download the latest Backendless SDK via CocoaPods (pod ‘Backendless’ 3.0.32 release), or from ios-SDK github (CommLibiOS and backendless).

Still same problem

A problem is with my sample project?

No, with my project

If you don’t use CocoaPods - you could get the libs CommLibiOS and backendless with them include folders from my project and set them to your project.
You can see on screenshot above (with my project), that easyTwitter really works via Safari View Controller.

Libs in my project are in Pods/Backendless/SDK/ios/

Yes, I found them and I replaced them…and still the login with Twitter is not with Safari View Controller

It’s fantastic! Could you upload your project to DropBox or Google Drive and send a link to support@backendless.com? We will investigate it.

I think you did not implement the application delegate for this case

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool

in your app.
See how it is in my project:

 // since iOS 9.0
 func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
 
 backendless.userService.handleOpenURL(
 url,
 completion: {(user: BackendlessUser!) -> () in
 print("(iOS9>) USER: \(user) -> \n\(self.backendless.userService.currentUser.name)")
}
 )
 return true
 }

You need

-(void)handleOpenURL:(NSURL *)url completion:(void(^)(BackendlessUser *))completion
to use Safari View Controller.

I can sent you only some screenshots…

Maybe is anything I missed up to setup?

And what about my comments above?

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool

this one I have implemented.
This one: -(void)handleOpenURL:(NSURL *)url completion:(void(^)(BackendlessUser *))completion
should be in the view controller where I want to make the login via Twitter?

I have that function too…