Search code examples
iosfacebook-ios-sdk

Video uploading issues using Facebook IOS app for other users


I uploaded video from using Facebook latest sdk its works fine. I have created in ios app in Facebook developer account. Still my app in testing mode. My app was not published in app store. I have tested with my facebook account video was uploaded to my facebook account . My app status was in live. I tried with my friend account below error came all the time. Please help me how to make works with other users. i have used code below for video uploading

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mov"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];

NSString* videoName = [filePath lastPathComponent];
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
[params setObject:@"testing from ios app" forKey:@"description"];
[params setObject:videoData forKey:videoName];

[FBRequestConnection startWithGraphPath:@"me/videos"
                                                                      parameters:params
                                                                      HTTPMethod:@"POST"
                                                               completionHandler:^(FBRequestConnection *connection,
                                                                                   id result,
                                                                                   NSError *error)
                                          {

                                          }];

In apple developer account only showing approved for email,public_profile,user_friends.

     permissions:(
    "public_profile"
)>, com.facebook.sdk:ParsedJSONResponseKey={
    body =     {
        error =         {
            code = 200;
            message = "(#200) Requires extended permission: publish_actions";
            type = OAuthException;
        };
    };
    code = 403;
}}

Solution

  • It means that you need request for publish_actions permission before upload. See Facebook Login for iOS, search for Checking for permissions.