First time authorization fails with FBConnect via mobile app - iphone

After downloading my app from app store (or via OTA) and trying to share via FBConnect SDK, the mobile app is launched but returns almost immediately to the app with error -999, without asking user for authorizations.
After that, clicking on FB share button reopens the mobile app and all goes well, authorizations are asked, my app is called back and display the FB dialog.
That issue only happens once : if I uninstall/reinstall the app and remove the FBapp authorizations from my FB account, all goes well.
I already specified the BundleID/iTunes App ID in the "Native iOS App" menu, and use the last FacebookConnect SDK.
Anyone experienced the same issue ?

Related

iOS Facebook Login Fast-App Switch Stays on Facebook App

I'll preface this by saying that this bug is difficult to reproduce and I have not been able to find a pattern for when it occurs.
When a user selects the Facebook login option in my iOS app, the app fast-switches to the Facebook app, and will stay in the Facebook app on the News Feed. Then when a user returns to my iOS app, and attempt to Facebook login again, it will fast-app switch and the login will continue as intended. When this bug occurs, it always fails, and then works reliably on the following attempt.
Make sure you have "fbXXXXXXXXXX:" in your plist
XXXXXX = you app id
When the app switches back it needs to know where to go, your app needs to respond to the url correctly.

Facebook iOS SDK login returns to app without showing dialog box

This is to document and share the solution to a problem I faced, hopefully it's of benefit to others as well.
Problem:
Using the Facebook iOS SDK to perform a Facebook login from my iOS app, it returns to my app immediately from the Facebook app without showing any login screen or dialog box if the user has already granted the requested permissions previously and logged out after that. This behavior is the same whether the login is via the Facebook iOS app or through a webview within the app itself.
This can be a problem especially if your app is trying to support multiple Facebook users, as users may not have already logged in to the correct account in the Facebook app beforehand. By returning to our app immediately without explicitly showing the Facebook account used, users will login with the current account used in Facebook, which could be the wrong account.
This behavior occurs when the "iOS Bundle ID" has been set in the app settings in Facebook https://developers.facebook.com/apps
This is also mentioned in Pro-tip 3 (which I believe was just recently added) of the Facebook Login doc.
In order to avoid this behavior, the "iOS Bundle ID" field needs to be blanked out. And from recent experience, this may involve deleting and creating the whole "Native iOS App" section again, as simply deleting the "iOS Bundle ID" and saving the changes does not appear to have any effect.

App Store can accept this flow or not

I have integrated Facebook functionality into my applications. By using the link https://github.com/facebook/facebook-ios-sdk, I have integrated the Facebook. In this application, at the time of login, it's opening Safari and at the same time the application is going to the background and then after login again it's coming back to the application. My intention is that this flow can accept the application store or not.
This is the official Facebook iOS SDK and many apps in App Store already use it. So you can use it inside your app.
Also, the flow in your question is exactly what the documentation of the library describes and is, again, used by apps that are already in App Store:
If the device is running in a version of iOS that supports multitasking, but it doesn't have the Facebook app of version 3.2.3 or greater installed, the SDK will open the authorization dialog in Safari. After the user grants or revokes the authorization, Safari redirects back to the calling app. Similar to the Facebook app based authorization, this allows multiple apps to share the same Facebook user access_token through the Safari cookie.
So, yes, there is nothing wrong with this flow.

iOS: Tapping on Facebook app login does not bring up allow/don't allow options for my app

Problem:
I run the sample iOS SDK code for facebook connect. When Facebook app is not installed, the sample app authenticates through Safari just fine and the sample app is able to post successfully.
When native Facebook app is installed, the sample app causes the Facebook app to be launched for authentication which shows a page that is requesting login for the demo app. When I press the login, it brings up another window that has the allow/"don't allow" options. So far so good. The problem is that if I logout from within the sample app (i.e., [_facebook logout:self]) and try to login again, pressing the "login" button in the Facebook app does nothing (it's supposed to take you to the allow/"do not allow" page).
I have specified the App-ID in the sample app and I have included the fb[app-id] (e.g., fb1234) in the plist under 'URL Types' (otherwise, the Safari authentication would not have worked either).
Any help is appreciated.
It does not take you again to the "allow/don't allow" page because the user already gave permission to the app. The only way the page can show again is when the user revoke the access from the Facebook admin panel. I'm not sure if there's a part of the API that can actually revoke the access of the app from the iOS SDK.

iPhone facebook connection is not working with existing native facebook app

I have an iPhone app using facebook connection using FBConnect from github code.
It worked fine in the simulator, however when I installed it in the device with existing facebook app from facebook it didn't work. It opens the existing facebook app instead of returning to my own app.
How to avoid this kind of conflict using FBConnect for facebook connection with existing facebook app?
FYI, facebook app screen says "You have already authorized MagLetters. Press "Okay" to continue." however when I click "Okay" it will bring me facebook app's default page not to my app.
I would check the following:
Are you running the latest Facebook App?
Did you setup the URL Schemes in your plist file?
Are you overriding the application:handleOpenURL: method?