iOS Facebook SDK: which login system is better? - ios

I am developing a iOS application which allows users to login by using their Facebook account.
I managed to implement the login procedure thanks to official tutorial I found here https://github.com/facebook/facebook-ios-sdk. I found here https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/authenticate/ another tutorial which looks pretty different since in the first tutorial the user signs in through Safari, instead in the second tutorial the native Facebook App is used.
Among these two systems, which one is better? Perhaps by using Safari I could avoid any issue concerning back compatibility with older versions of iOS?
Thanks!

If you're using the official Facebook SDK, here's what happens:
If a user does have the Facebook app installed, they'll be taken to it to authenticate and login to your app.
If the user does not have the Facebook app installed, they'll be taken to Safari to authenticate and login to your app.
Either way, the login process is the same. After they authenticate, they're returned to your app using a specific URL scheme so that you can continue with what you're doing.
Finally, if you're targeting iOS 6 only, you can take advantage of the single sign on features built into iOS. Check the docs for more information on that.

Related

IOS Apps login via Linkedin authentication SDK

i'm created a IOS app in Xcode7 using swift , and now i am trying to integrate LinkedIn authentication to login into my iOS app.
So i created a account and application in LinkedIn developer site..
But my requirement is to use the same LinkedIn application account to login into my all iOS apps.is it possible?
i heard about deep linking concept.Any one know more about that?
Is it possible?
Yes it is. In your app preferences, go to Mobile > iOS preferences, then add the bundle ID of each app you want to be linked with LinkedIn.
Deep linking : Any one know more about that?
It allows you to bring users into a more specific part of your app that is not home page. For example, after opening a notification, you can bring user to a specific post into your app. That is an example of using deep links. Nevertheless, I don't think it is what you are searching for.

Share using Facebook Application

Right now I'm using a Facebook SDK to share posts from my application. The problem is that this sdk pops up a webview inside my app and asks the user to log in. There has to be a better way.
Can I send the share information to the facebook app on the users device (If they have it installed)? Or at least leverage the facebook app to check credentials? If people have to sign in to share, they probably won't do it..
The latest Facebook SDK 3.5 includes a native share dialog. If you follow the authentication workflow according do the documentation and the phone is on iOS 6.0 you should not get a UIWebView during authentication, instead you will get a UIAlertView.
Facebook login process would use WebView only in a few cases. Some of them are:
1) You are asking it to do so explicitly, by using - (void)openWithBehavior:(FBSessionLoginBehavior)behavior completionHandler:(FBSessionStateHandler)handler; which, I think, is not your case.
2) If there is no Facebook app installed on the device, FB SDK falls back to using WebView login window.
3) Probably, this is your case. If you are requesting publish permissions on the first attempt to open FB session, FB SDK will also fall back to old login flow envolving WebView. In the new login flow, FB session is supposed to be open with read permissions first (in that case, FB will use fast app switching or native iOS FB login):
+ (BOOL)openActiveSessionWithReadPermissions:(NSArray*)readPermissions allowLoginUI:(BOOL)allowLoginUI completionHandler:(FBSessionStateHandler)handler;
Then, you should ask additional publish permissions from the user:
- (void)requestNewPublishPermissions:(NSArray*)writePermissions defaultAudience:(FBSessionDefaultAudience)defaultAudience completionHandler:(FBSessionRequestPermissionResultHandler)handler;
That way, user will not need to log in (if he is logged in FB app already), but there will be inconvenience of double switching from your app to FB (though it works rather fast lately).
I was looking for a cleaner way to get publish permissions with FB Single Sign On on the first call, but unfortunately didn't find anything working yet.

Is there an open source iOS app that allows user to sign up and log in with Facebook authorizations?

I am interested in learning the best practices on managing user session and organizing the ViewControllers for signup/login.
Here is the Facebook HackBook Sample iOS app, that should help along with the official docs
Hackbook for iOS
Demonstrates how to use the Facebook Platform to integrate your iOS
app. This sample initially asks the user to log in to Facebook then
provides the user with a sample set of Facebook API calls such as
logging out, uninstalling the app, publishing news feeds, making app
requests, etc.
Everything is here that you should know,
https://developers.facebook.com/docs/mobile/ios/build/
Step 3
Step 4
is the most relevant to your question

facebook dialog ios for login

I have followed the example of Facebook SDK for iOS (Hackbook) and it works well however whenever the person is logging in the app takes take the person to Safari or the Facebook app (if you have it installed on the device). Is there a way I can call the permission without leaving the app.
Thanks
there once was. But facebooks says that you should use SSO (single sign on) with the official facebook app. So even if you'd modify the files of the facebook-ios-sdk, it would probably not work.

Facebook iOS SDK: How to Persist Login to File or Database?

I'm fairly new to iOS development, and I'm starting work on an App that will include some simple Facebook integration. As a proof of concept, I made a bare-bones, view-based application that has a simple button to log a user in to Facebook, and then another button to post a status update.
This is all well and good, but in a real world scenario, a user shouldn't have to login to Facebook every time they want to use the Facebook-integrated features of my App. My question is this: how would I go about persisting a user's login to a file, or to a database for use in a later launch of my App?
Ideally this solution would use Facebook's iOS SDK, but I wouldn't be opposed to building my own authentication system using their Graph API. The advantage of using Facebook's official iOS SDK, though, is that it can use the login information already associated with the phone's Facebook application (if installed), or the login associated with facebook.com on mobile Safari.
I'm not providing my current source code, on the basis that this is a general enough question to not require the specifics of my Facebook SDK usage. However, if you think it would be helpful, I'd be more than happy to post my code.
Thanks!
you wouldn't do that. check out facebook SSO in their SDK ( see https://developers.facebook.com/docs/guides/mobile/ ). You request the facebook token everytime you use it or otherwise get an long-term (read: use access token offline_access) access token and persist this token to the NSUserDefaults for use in your app. ( see http://coffeeshopped.com/2011/01/saving-sessions-with-the-facebook-ios-sdk )

Resources