Nirav Bhatt
Nirav Bhatt

Reputation: 6969

Facebook Share Dialog: Permission Error - OAuth "Facebook Platform" "insufficient_scope (#200) Permissions error"

My requirement is here:

Share to Facebook from my app using Open Graph Action - using Share Dialog (because I don't want special dialog for login)

I request publish permission, and upon obtaining it I try to share via Post dialog. Here is the brief code I use:

[FBRequestConnection startWithGraphPath:@"/MY_FB_APP_ID/app_link_hosts"
                                 parameters:paramsForAppLinksHost HTTPMethod:@"POST"
                          completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
     {
         NSString * appLinkHostURLID = [result objectForKey:@"id"]; // store this ID in an NSString

         if(error)
         {
             NSLog(@"error = %@", error.description);
         }
         else
         {
             [self ShareToFB : appLinkHostURLID];  //Code to share OG story via Share Dialog
         }

     }];

However, above error gives me this:

com.facebook.sdk:HTTPStatusCode=403, com.facebook.sdk:ParsedJSONResponseKey={
body =     {
    error =         {
        code = 200;
        message = "(#200) Permissions error";
        type = OAuthException;
    };
};

The problem with Facebook SDK is that there is so much documentation and almost no support that I haven't got my previous questions answered too (where I was trying to share without permission), and this problem simply doesn't yield.

Somebody please tell - Is having FB app approved by Facebook a REQUIREMENT for this to work perfectly? If so, how does one correctly provide app store ID when the app isn't even live on Apple store? They use it even in code for applinks related permissions (see above).

The crux of the issue is that everything works with developer facebook login perfectly but fails with another FB user. This means that all my plist and everything is OK. However the FB app isn't submitted (and for many valid reasons such as my iOS app is still in development - how can one be expected to submit screenshots and all even before app is live?)

Someone please help...

Upvotes: 1

Views: 2375

Answers (1)

Nirav Bhatt
Nirav Bhatt

Reputation: 6969

OK, I figured it out myself - like many other developers.

1 - This error is due to the fact that FB app isn't approved for certain permissions but still trying to use / request that permission from user. publish_action is one such permission.

2 - In order to test this, facebook app developer needs to approve test users from within develolper.facebook.com portal.

3 - This test user is located in your FB app portal under:

a) Status & Review -> Items under Review section

and

b) Roles section.

You (FB app administrator Developer) need to add the user in b), and not a).

Then the user needs to approve your request. And in order to do that, he needs to register himself as FB developer too.

So much for neat documentation...one can easily get lost. The github samples and all are great, but none of them tells the whole picture.

Alas, they modify their error descriptions instead.

Upvotes: 2

Related Questions