简体   繁体   English

分享视频链接到Facebook iOS

[英]Share video link to facebook ios

I am working on a ios app. 我正在使用ios应用程序。

I need to share a video link to facebook.Video will save on my server. 我需要分享一个视频链接到facebook.Video将保存在我的服务器上。

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. 但是,如果我尝试共享静态链接,请说“ www.google.com”。

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. 用户将在Facebook按钮上选中标记,并且供稿将同时在Facebook和我的应用程序上共享。

Thanks for help. 感谢帮助。

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.) com.facebook.sdk code=5 the operation couldn't be completed. (com.facebook.sdk error 5.)知道这里出了什么问题,但是据我所知,Facebook返回com.facebook.sdk code=5 the operation couldn't be completed. (com.facebook.sdk error 5.) com.facebook.sdk code=5 the operation couldn't be completed. (com.facebook.sdk error 5.) this error in few cases, like com.facebook.sdk code=5 the operation couldn't be completed. (com.facebook.sdk error 5.)在某些情况下(例如,

  1. Session is is not open. 会话未打开。
  2. Facebook has detected that you're spamming the system. Facebook检测到您正在对该系统进行垃圾邮件发送。
  3. Facebook has a defined limit using the SDK. Facebook使用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 当我尝试打开链接时 在此处输入图片说明

Facebook need to parse your url. Facebook需要解析您的网址。 May be that's why fb not give you to post the url. 可能就是因为这个原因,FB不允许您发布网址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM