"The app must ask for a basic read permission at install time"
Asked Answered
T

3

18

I am using the iOS Built in frameworks to connect. After asking for "publish_stream" permissions, FB returns an error:

Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: The app must ask for a basic read permission at install time." UserInfo=0x145ad6a0 {NSLocalizedDescription=The Facebook server could not fulfill this access request: The app must ask for a basic read permission at install time.}

What is going on here? Showing two user permission popups is a less than ideal user experience.

Tanishatanitansy answered 15/9, 2012 at 23:28 Comment(0)
T
17

The very first time, you must ask for read permissions. You cannot auth the user initially with any type of publish/write permissions. What you should do after that is, where it makes sense in your app, ask for publish_stream permission. Definitely do not do the initial permission and then immediately ask for the publish_stream permission.

See this note in https://developers.facebook.com/docs/tutorial/iossdk/upgrading-from-3.0-to-3.1/, section "Asking for Read & Write Permissions Separately". Even though this applies to the Facebook SDK for iOS it is an extension of the same requirement in the built-in framework.

Toner answered 26/9, 2012 at 3:2 Comment(6)
I'm asking for @"user_about_me" and still got this error. What's wrong ??Segalman
Are you asking for only user_about_me when you get this error? Also if you can provide the code you're using that will help.Toner
thanks the problem is already fixed. There were some lags on FacebookSegalman
This is really poor design. My app just needs to publish to the user's news feed without reading anything. The docs say It is important that you do not simply attempt to call the two individual methods back-to-back to replace either of the deprecated functions. How am I supposed to ask for read permissions first without asking for them back-to-back other than to pop up a dialog at some random time?Aftertime
The Share Dialog released with 3.5 (in limited beta right now), should help you out Kevin.Toner
I found replacing the previous permission with @"basic_info" ([FBSession openActiveSessionWithReadPermissions:@[@"basic_info"]) fixed it for me. I also found that the order mattered and that @[@"public_profile", @"basic_info"] didn't work even though it contained the basic info callSago
T
5

I would like to add that there is an additional caveat in the Facebook docs:

// if a user has *never* logged into your app, you MUST include one of
// "email", "user_location", or "user_birthday".  Other read 
// permissions can also be included here.

Failure to do this leads to the same error.

Telegraphese answered 11/12, 2012 at 23:23 Comment(0)
N
4

In the latest SDK (v3.5) you also need to pass @"basic_info" in the permissions array. It used to be implicit, but not anymore. If you don't, you'll get the "The app must ask for a basic read permission at install time" message

  [FBSession openActiveSessionWithReadPermissions:@[@"email", @"basic_info"]
                                 allowLoginUI:YES
                            completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                              [self sessionStateChanged:session state:state error:error];
                            }];

From the method docs:

readPermissions - An array of strings representing the read permissions to request during the authentication flow. The basic_info permission must be explicitly requested at first login, and is no longer inferred, (subject to an active migration.) It is not allowed to pass publish permissions to this method.

Nodical answered 28/6, 2013 at 14:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.