FBWebDIalogs generates 'An error has occured' when trying to post a feed in iOS - ios

I'd already implemented an App both on FB and iOS that published updates to the users timeline using the Feed Dialog. This was working as intended up until a few months ago, when most users started seeing the 'An Error has Occurred. Please try again later' page.
I set out to update the FB SDK to the latest version and hopefully fix this issue. Initially I have had success posting stories with the basic tutorial app, but once I removed the native IOS FB login settings, the error screen re-appeared.
Steps to reproduce:
Start with a fresh iOS simulator.
Log in to Facebook via the setting screen.
Run the basic tutorial, with FBWebDialogs presentFeedDialogModallyWithSession:parameters:handler: added as a share button.
Login works as expected.
Share works as expected and presents the web dialog allowing me to post to my timeline.
Quit the App (not just switch out of it)
From Settings, delete the Facebook account.
Re-run the App and tap login -- you will be presented with the web login dialog.
Login and 'share' to make the call to FBWebDialogs.
Note the 'error has occurred' screen.
Dismiss this and tap the logout button.
Tap login, and once again, you will be presented with the web login dialog.
Login and notice you are asked to confirm the FBApps access (you'll be told it's already been authorized). Tap OK.
Tap Share and you will now see the 'Feed' dialog as expected.
(You can logout or not at this step, it makes no difference). Go back to the iOS settings page and re-add your Facebook account.
Run the App, and tap log in.
You will be presented with the web UI login screen (this is not expected).
After logging in, tap share to initiate a FBWebDialog call.
Note the 'error has occured' screen. At this point, it is impossible to post except by deleting the Facebook account in iOS settings and going back to step 8.
The problem seems to occur if the user ever deletes their FB settings from the device. Also, if the user has had FB settings on their device via the iOS settings screen and then tries to log in via the web ui, the feed dialog post will fail.
I'd like to know how to solve this problem.

Related

Login to Facebook Without Leaving App

I am using the Facebook SDK and I use the standart way of logging in a user (I use a FBSDKLoginButton). The problem is that when the user clicks on the view my app goes to the background and safari opens.
My app got rejected from the appstore because of this.
How can I make the login happen inside my app?

How does foursquare app on iOS auto log me in?

Background: I was looking for a good copy for my app to use facebook login.
I searched for top apps which uses fb login and foursquare was one of them. I haven't use the app in a while. I downloaded it again and click open. They have updated the app and displays a series of screens about new tutorials and features. At the end of it, it automatically log me in and knows who I am. I'm confused about this. I did not click on any 'login with facebook' or enter any credentials.
I also went to www.foursquare.com and after a few seconds, the website reloads and logs me in. The profile is the same as my iOS one.
Another detail that interest me is that the email address I use for foursquare is not the same as my facebook one. I check my fb apps and foursquare is not listed there so there is no connection between fb and foursquare in my limited knowledge.
I deleted the app, reinstall, and open it and it immediately know who I am.
How does it work?
Thanks,

SLComposeViewController Is there anyway to bypass settings view after user registers first time facebook and twitter accounts?

I am working with the iOS application which shares post on facebook and twitter. My problem is when i post first time to facebook or twitter. I am getting this alert
On clicking setttings button, i am redirected to Settings View. But after Login success i need to close the settings view and go back to my application and reopen it to post on twitter/facebook. Is there anyway to bypass settings view and show my application view directly after register success? I dont wanna close settings view and reopen my application.
Waiting for your hint ;)
Thank you.

iOS Facebook switches back to app between login & permissions

I'm trying to setup my app to publish a simple post to a user's Facebook feed (image url, link, description). They don't need to use Facebook for anything else so the first time they click "Share" it needs to authorize the app, and the publish permissions.
If they have their credentials stored in the device as of iOS 6 they simply get two alert boxes and it's done with. But if they don't, or have an older version, it switches out to Safari for login. My problem is that it is then switching the user back to my app, then immediately back again to Safari to accept the publish permission. It's very jarring and unprofessional.
What I would like is for the page in Safari to change after the login to the permissions page so they can accept it, and THEN switch back to my app. I know this can be done because the popular Mixology app does exactly this behavior. Unfortunately Facebook keeps changing their SDK and all the information I find online is outdated.
I wrote up a solution here: FacebookSDK presents login UI twice to avoid the double switch.
Basically, you can use openActiveSessionWithPublishPermissions: to do what you want. However, you have to handle the special case where the user has signed in to Facebook from the device settings, which requires requests for read and publish permissions into two separate calls.

Facebook ios sdk authorize opens two permissions request dialogs

Calling authorize from our game (using Facebook ios sdk 2.x or 3.1) results in two permissions dialogs in the Facebook App. Similar odd behaviour is demonstrated in the web browser if the Facebook App is not present on the device but I will refrain from describing that specific case.
During testing we found that...
On iPhone
Accepting the first permission dialog results in a blank dialog with a cancel button. Clicking on cancel will dismiss the dialog, briefly show a second (exact duplicate) permissions dialog, and then return the user to the app. If the user returns to the Facebook app, they will see the second permissions dialog still there.
On iPad
Accepting the first permission dialog often results in a blank dialog with a cancel button. Clicking on cancel (or if the cancel dialog doesn't show at all) will show a second (exact duplicate) permissions dialog. Clicking 'Allow' on this dialog will return the user to the app.
Here are some images to help illustrate the ipad case:
First permission dialog shows: https://www.evernote.com/shard/s54/sh/3037a5b8-d55a-4bc2-ad11-a889202ca596/14f2e1241ee78c333c6cb2c8f978adfe
User clicks 'Accept' and then Blank cancel dialog shows: https://www.evernote.com/shard/s54/sh/8ef40f24-7291-4592-9faa-9e2f322c0652/66ae6f4e43192510a7beeb9fb154bd04
User clicks 'cancel' and then second permission dialog shows: (refer to first image... I hit my max 2 links already)
User clicks 'Accept' and flow returns to the game (also not shown)
I've since tried out the same steps using a popular Facebook game - Diamond Dash. On iPad you will see a similar double permissions dialog (minus the blank cancel dialog). If you 'Allow' the first permission dialog, control will return to the game. If you then go back to the Facebook App, you'll see the second permission dialog hanging around.
Ultimately the user can get through the multiple dialogs and go on to play the game... but certainly the flow is messy.
So my questions are:
1) How can we get rid of the blank cancel dialog after accepting permissions and
2) How can we get rid of the double permission dialog (or at the very least ensure that on iPad, the first permission dialog will return the user to our app)
I've searched through other posts related to blank fb dialogs and so far everything points to session expiry (or re-asking for permissions after already being granted) so I believe this is a new bug report.
A few of the things I've tried on the Facebook site admin page:
turned off enhanced auth dialog (no difference)
turned off authenticated referrals (no difference)
removed all permissions we ask for (no difference)
using or not using an url scheme has no effect
single and multiple bundle ids
removing the iphone app id
Any help at all would be greatly appreciated!
So after mucking with Facebook settings for awhile, it appears that setting the "Enhanced Auth Dialog" (in Advanced section) to true has fixed the problem with the blank cancel screen. The double permission dialog problem is still there, but since the second dialog is shown just before the user is flipped back to the game, it's not very disruptive.
Of note, new Facebook apps no longer have a setting for Enhanced Auth Dialog. I believe these newer apps force the setting to true.

Resources