Domanda

I am working on a ios app.

I need to share a video link to facebook.Video will save on my server.

I am using below code:-

params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                  AppName, @"title",
                                   AppName, @"name",
                                   [NSString stringWithFormat:@"%@",text], @"caption",
                                    composeViewController1.text, @"description",
                                    Path, @"link",
                                    [NSString stringWithFormat:@"%@%@app_icon-DEMO.png",ServerPath,URLImageFolder], @"picture",
                                   nil];
[FBRequestConnection startWithGraphPath:@"/me/feed"
                                 parameters:params
                                 HTTPMethod:@"POST"
                          completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                              if (!error) {
                                  // Link posted successfully to Facebook
                                  NSLog(@"result: %@", result);
                              } else {
                                  // An error occurred, we need to handle the error
                                  // See: https://developers.facebook.com/docs/ios/errors
                                  NSLog(@"%@", error.description);
                              }
                          }];

But i am getting below error from this

Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xc52be90 {com.facebook.sdk:HTTPStatusCode=500, com.facebook.sdk:ParsedJSONResponseKey={
    body =     {
        error =         {
            code = 1500;
            "error_subcode" = 1609005;
            message = "This link could not be posted.";
            type = FacebookApiException;
        };
    };
    code = 500;

But if i try to share static link say "www.google.com" it is working.

My app's flow is :-

User will check mark on facebook button and the feed will share on facebook and my app at the same time.

Thanks for help.

È stato utile?

Soluzione

I don't know exactly whats going wrong here, but as far I know Facebook return com.facebook.sdk code=5 the operation couldn't be completed. (com.facebook.sdk error 5.) this error in few cases, like

  1. Session is is not open.
  2. Facebook has detected that you're spamming the system.
  3. Facebook has a defined limit using the SDK.
  4. You don't have permission to do so or wrong publish permission.

The link you have provided is not working. When I tried to open the link it's say enter image description here

Facebook need to parse your url. May be that's why fb not give you to post the url.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top