Search code examples
iosfacebooktitaniumsingle-sign-onappcelerator

Titanium iOS - Facebook SSO not returning to App


I've recently added Facebook Single Sign On within my application using Appcelerator' Titanium. Which is working nicely but is failing to redirect back to my application automatically when presented with the "Already Authorized" facebook page.

If the user clicks the "Okay" button within facebook the Application re-opens and works as per usual. I'm just looking to get rid of that extra step for users.

Any suggestions? I've come across Objective C solutions such as : Does the Facebook iOS SDK require the user to authenticate every time they use the app?

Cheers, Tom


Solution

  • I believe the issue was related to the Facebook App not being setup properly and not directly testing on a device instead of the simulator.

    The following settings should be applied within you Facebook Application.

    Enable : Native iOS App

    • iOS Bundle ID: com.yourcompany.yourapp
    • iPhone App Store ID: 24242423
    • Configured for iOS SSO: Enabled

    Testing on the simulator will trigger Safari to open and show the Authorization dialog due to the Facebook App not being installed (hence why you need a real device). Pushing your app to the device and triggering the SSO within your application will then redirect back to your application if an error, already authorized or success occurs.

    Hope this helps anyone that's had this occur.