7

Somewhere along the way in the past few weeks, the authorize Facebook call in iOS fails with a "Page Not Found". This happens for any user that has not installed the app or if the app's permissions have changed and the user must approve the additional permissions. This happens whether the Facebook app handles the user authentication or Safari or the popup dialog. All redirect to a "Page Not Found" page.

Digging through the debugger, I found the initial URL request to be (app id replaces "[app_id]") for the login screen:

https://m.facebook.com/dialog/oauth?type=user_agent&display=touch&redirect_uri=fb[app_id]%3A%2F%2Fauthorize&sdk=2&scope=user_location%2Cuser_relationships%2Cemail%2Cpublish_stream%2Coffline_access&client_id=[app_id]

The following URL is being sought by the login attempt (I assume by the URL that the user has insufficient permissions):

http://www.facebook.com/dialog/permissions.request?_path=permissions.request&app_id=[appid]&redirect_uri=fb[appid]%3A%3F%3Fauthorize&sdk=2&display=touch&type=user_agent&fbconnect=1&perms=user_location%2Cuser_relationships%2Cemail%2Cpublish_stream%2Coffline_access&sso=iphone-safari&from_login=1

I've checked that the Bundle ID listed in Xcode is the same as that listed for my app's settings in Facebook.

Because the permissions page is not showing, new users cannot add the app. Old versions of my app that used to work are failing in the same way as well. What could be the problem?

bill.lee
  • 2,207
  • 1
  • 20
  • 26
  • Okay, it _must_ be something to do with the FB settings for the app. But have no idea what. I have set up the the FB DemoApp to use my failing app's app_id and it fails (so I know it isn't necessarily my code). I then set it to a different app's app id that I am no longer developing; and it WORKS! I cannot tell what the difference between the two different configurations are. Ugh! – bill.lee Sep 27 '11 at 01:24

3 Answers3

5

Okay, I'm feeling a bit stupid.

The problem was that I had Sandboxing turned on in the app settings in the Facebook page. Why the error page was so obtuse is beyond me.

  1. In Facebook developer settings: https://developers.facebook.com, edit your app settings.
  2. Select the "Advanced" tab, under "Settings" on the left side.
  3. Make sure that "Sandbox Mode" is not enabled.
bill.lee
  • 2,207
  • 1
  • 20
  • 26
  • It's an old trouble for me as well. In sandbox mode, only users you add into your dev team can access the app, otherwise it will reposrt: content not found. – Hoàng Long Sep 27 '11 at 06:49
  • Ah, this problem for me too, even though I was the app administrator. I think it's because I created the facebook app *after* logging into facebook on android. Solution: log out of facebook app on android, log back in again. – Timmmm Nov 28 '12 at 18:58
3

I had the same problem, when my App ID was incorrect in Info Plist.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb305639062848xxx</string>
        </array>
    </dict>
</array>

I found out, that not the Apple App ID must be put there, but Facebook App ID. (General in your app settings on Facebook developers web page, under App Name there are App ID and App Secret)

There 3 last numbers are hidden by xxx.

Denis Kutlubaev
  • 15,320
  • 6
  • 84
  • 70
0

If the link you post is exactly the link in your application, then "redirect_uri" parameter is missing the letter "e". "fbconnect" as well.

http://www.facebook.com/dialog/permissions.request?_path=permissions.request&app_id=[appid]&redirct_uri=fb[appid]%3A%3F%3Fauthorize&sdk=2&display=touch&type=user_agent&fbocnnect=1&perms=user_location%2Cuser_relationships%2Cemail%2Cpublish_stream%2Coffline_access&sso=iphone-safari&from_login=1

Besides, you should make sure that your [appid] is correct, and fb[appid]%3A%3F%3Fauthorize is the correct FB handler link of your application.

Hoàng Long
  • 10,746
  • 20
  • 75
  • 124
  • No, I had to transcribe it, so it was a typo. Are you able to authorize a new use into your iOS apps? – bill.lee Sep 26 '11 at 17:59
  • The code used to work fine. I'd been testing it as an authorized user for a long time and did not notice when this stopped working. The 2nd URL is generated by Facebook, the result of my logging in as a user that needs to allow app permissions. The first URL is generated by the iOS SDK and continues to work for users that have already allowed the permissions for the app. – bill.lee Sep 26 '11 at 18:03
  • @wrlee: no, I only integrates Facebook for website, but the OAuth flow should be the same. I have checked the url, it works for my app. About changes in Facebook settings, I notice that FB is going to force https. Does it have any effect on your application? – Hoàng Long Sep 27 '11 at 03:00