Sergey Stadnik
Sergey Stadnik

Reputation: 337

Live video. (#100) No permission to perform current operation

I want to make live video stream from my IOS app to Facebook. I have two facebook account: first - with registered iOS app, second account - only for the test. If I log in with my first account(in my iOS app) - I get the required rtmp://rtmp-api.facebook.com:80/rtmp URL and secret key for the streaming (everything as stated on the FB documentation: https://developers.facebook.com/docs/videos/live-video-api). But if I'm using second account for login, I'm receiving this error:

com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
    body =     {
        error =         {
            code = 100;
            "fbtrace_id" = Ed9BmMChIsn;
            message = "(#100) No permission to perform current operation.";
            type = OAuthException;
        };
    };
    code = 400;
}, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=400,

My code for live streaming:

- (void)enableFacebookLiveStreamingWithCompletionHandler:(void(^)(NSString* facebookStreamURL, NSString* facebookStreamKey, NSError* error))completionHandler;
{
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([[FBSDKAccessToken currentAccessToken] hasGranted:permissionPublishActions])
        {
            NSString* liveVideosRequestPath = [NSString stringWithFormat:@"/%@/live_videos",[FBSDKAccessToken currentAccessToken].userID];
            FBSDKGraphRequest* request = [[FBSDKGraphRequest alloc] initWithGraphPath:liveVideosRequestPath parameters:nil HTTPMethod:@"POST"];

            [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {

                NSLog(@"%@",[FBSDKAccessToken currentAccessToken].permissions);

                if (error)
                {
                    if (completionHandler)
                        completionHandler(@"",@"",error);
                }
                else
                {
                    if (completionHandler)
                        completionHandler(@"rtmp://rtmp-api.facebook.com:80/rtmp/",[[result objectForKey:@"stream_url"] lastPathComponent],nil);
                }

            }];
        }
    });
}

P.S// Very interesting that even though I have included all the permissions here: https://developers.facebook.com/tools/explorer, all the same to me denied access for second account for testing(on which the application is not registered)!

Help me please.

Upvotes: 4

Views: 1572

Answers (1)

andyrandy
andyrandy

Reputation: 74014

Most permissions need to get reviewed by Facebook, else you can only use them as users with a role in the App. Read about "Login Review" in the docs: https://developers.facebook.com/docs/facebook-login/review

Upvotes: 1

Related Questions