How can I skip the Facebook iOS one-time login permission dialog?
I have an iPad app that requires users to log into Facebook. I have implemented this with the iOS SDK that comes with Facebook, but I am at a loss for returning users. Here are the steps they take:
- The user downloads our application for the first time.
- They hit "login", which redirects them to the Facebook iPad app, if installed.
- They see the permission dialog they accept.
- They exit our application and close it.
- Later they open our application again.
- They click "login" in our application.
- This will bring them to the iPad for iPad app showing the blank rights dialog shown below as they have already authorized us and given us full permissions.
The problem is that we see confused users because the call to action ("Good") is buried in the upper left corner of the title bar and the messaging is unclear. In our testing, the Flipboard app displays a dialog in this situation, but it closes automatically and control returns to the calling app. This is what we would like to happen in our case, but it is not clear how to achieve this. Here are a few things I've tried so far that haven't solved the problem:
- Updated to the latest iOS SDK for Facebook at https://github.com/facebook/facebook-ios-sdk
- Passing a null or empty array to [authorize user]
- Searched the documentation (and the internet) for any relevant leads.
- Checks SDK code for any undocumented parameters
Does anyone have any suggestions on how to skip this re-login dialog on re-visit? Any help is greatly appreciated.
source to share
This was demonstrated in the iOS API documentation for Facebook , specifically in step 4 of the section "Modifying the Application Delegate Header File"
if (![facebook isSessionValid]) {
[facebook authorize:nil]; // this is what displays the facebook dialog
}
isSessionValid
checks if a valid cookie exists, and if so, you don't need it again authorize
.
Edit:
It seemed to me that if your users don't use your app for a long time, your cookie will expire. In this case, I'm not sure if we can do anything about it, because FB (re) authentication depends on this dialog.
source to share
Are you storing the session information as described in step 6 and reading the IOS tutorial in step 3 ?
If so, if you need to start distributing the token: https://developers.facebook.com/docs/mobile/ios/build/#extend_token
This is relatively new, now offline_access
out of date.
source to share