How to implement facebook cross-apps authorization for iOS - ios

I'm developing mobile app for iOS 8 with Firemonkey (just for info) and my app works with Facebook. I did Facebook authorization though browser by specifying email and password. Everything works fine, but now I'd like to auto login to my custom iOS app without specifying email and password, if I already logged in to the native Facebook app.
For example, we have two iOS 8 apps: 1) native Facebook app and 2) my custom app. All apps are logged out of Facebook. I login to native Facebook app, then open my custom app. How can my custom app retrieve access token from native Facebook app for auto login?
I will be grateful for any code example in any programming language.

Related

How to share Auth0 session from iOS app to SPA on same tenant

I successfully implemented Auth0 login on my native iOS app, all credentials are stored and all works well. Problem I'm facing is when I want from that app to open url on button tap in (wkwebview, or safari, or in sfsafaricontroller), that link walk me to single page app which is on same tenant as my iOS app, this web page want from me to enter again email and password. Is anyone achieved single sign on between iOS app and spa it this way?

How to enable cross app authentication for iOS apps?

Is there a method for cross app authentication in iOS that allows a user who has an authenticated session with one app to get authenticated for another app from the same developer? It works pretty nicely for the Facebook app and Facebook messenger on iOS, but I couldn't find any documentation on it.

Facebook iOS Auth without app switching

Our iOS app currently uses basic Facebook authentication to get user profile info. When the user taps on authenticate, the app does a fast switch between the Facebook App and our app to authenticate.
We would like to avoid the fast switch and remain in our app while we authenticate the user with FB. We noticed that this was done nicely on the Beats Music app for iOS.
Thanks in advance,
AppsXpress

openActiveSessionWithReadPermissions does not login with ios6 native login

I am using Facebook SDK 3.7.1.
I am trying to login using openActiveSessionWithReadPermissions, but it always direct me to safari, even when I have the native login account setup.
here's what i have done:
1,on the plist, I set the FacebookAppID, the FacebookDisplayName, and the URL Schemes as suggested.
2,on the facebook account, I set up the BundleID, and enable Facebook Login under Native iOS app.
3, I am not loggin in as a test user, Facebook iOS 3.1 SDK: can login with Safari but not natively
Can anyone give me some suggestions where goes wrong?

How does Facebook Messenger iPhone app gets login information from Facebook iPhone app?

If you have both Facebook iPhone app and Facebook messenger app installed in your iPhone, I noticed that, as long as you are logged in in the Facebook app, Facebook messenger app knows who you are immediately!
How did facebook do that?
How do two applications talk to each other?
I am interested to know this because I want to know if it is possible for two applications to share some common data (e.g. products database) so that those data only has to be updated in one app.
A suite of iOS applications can use Keychain Access sharing to share credential information. You cannot, however, share a database on the device. You would need to either create one monolithic app, or store the shared data off-device.
I'm gonna take a guess but I think they storage your UDID in their DBs with the current logged user
Basically this is done using Single Sign-On (SSO) feature of the Facebook iOS SDK. According to the facebook developer documentation, https://developers.facebook.com/docs/mobile/ios/build/#implementsso,
it states that if the user already has the Facebook app of version greater than 3.2.3 installed and that the iOS device of the user supports multitasking, then basically the app (the facebook messenger in this case) can ask for the current logged in user information from the main Facebook program.
"One of the most compelling features of the iOS SDK is Single-Sign-On (SSO). SSO lets users sign into your app using their Facebook identity. If they are already signed into the Facebook iOS app on their device they do not have to even type a username and password. Further, because they are signing to your app with their Facebook identity, you can get permission from the user to access to their profile information and social graph"
"If the app is running in a version of iOS that supports multitasking, and if the device has the Facebook app of version 3.2.3 or greater installed, the SDK attempts to open the authorization dialog within the Facebook app. After the user grants or declines the authorization, the Facebook app redirects back to the calling app, passing the authorization token, expiration, and any other parameters the Facebook OAuth server may return."

Resources