简体   繁体   English

从iOS应用发布到Facebook的视频帖子未显示在Facebook时间轴上

[英]Video post from iOS app to Facebook is not showing up on Facebook timeline

I've implemented the graph API POST /me/photos in my iOS app and its working fine. 我已经在我的iOS应用中实现了图形API POST / me / photos,并且工作正常。 Same way I implemented the /me/videos with host graph-video.facebook.com suggested in Facebook documents and this link : [ cURL - is there a way for upload a video to facebook without form? 我用Facebook文档中建议的主机graph-video.facebook.com来实现/ me / videos的相同方法,并且此链接也是如此:[cURL- 有没有办法将视频上传到没有格式的Facebook? I get success response for this too like below but the video is not showing up on my Facebook account. 我也收到了类似的成功回复,但该视频未显示在我的Facebook帐户中。

{
id = 10150481253673034;
url = "https://graph-video.facebook.com/me/videos";
}

Here is the code I have written : 这是我写的代码:

NSString *str=[[NSBundle mainBundle] pathForResource:@"samplevideo" ofType:@"mov"];
NSData *imageFBData = [NSData dataWithContentsOfFile:str];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                                     imageFBData, @"source",
                                     @"multipart/form-data", @"Content-Type",
                                     message, @"message",
                                     nil];
[FBRequestConnection startWithGraphPath:@"https://graph-video.facebook.com/me/videos"
                                             parameters:params
                                             HTTPMethod:@"POST"
                                      completionHandler:^(
                                                          FBRequestConnection       *connection,
                                                          id result,
                                                          NSError *error
                                                          ) {
                                          // handle the result
                                          NSLog(@"result : %@",result);
                                          if(error)
                                              NSLog(@"error : %@",error);
                                      }];

if I use the URL as "/me/videos" like I use /me/photos instead of https://graph-video.facebook.com/me/videos , I get the below error: 如果将URL用作“ / me / videos”(例如,使用/ me / photos而不是https://graph-video.facebook.com/me/videos) ,则会收到以下错误:

{
body =     {
    error =         {
        code = 352;
        message = "(#352) Sorry, the video file you selected is in a format that we don't support.";
        type = OAuthException;
    };
};
code = 400;
}

I tried with both .mp4 and .mov which are in supported videos. 我尝试使用受支持的视频中的.mp4和.mov。 I'm sure there is no issue with video because the same video I upload to amazon S3 before posting to FB and I can play the uploaded video. 我确定视频没有问题,因为发布到FB之前我上传到Amazon S3的视频相同,我可以播放上传的视频。 Here is one sample: https://tagg-social-staging.s3.amazonaws.com/uploads/posts/videos/36/post-video.mp4 Note: I'm not posting the video using the above URL, but as multipart /form-data 这是一个示例: https : //tagg-social-staging.s3.amazonaws.com/uploads/posts/videos/36/post-video.mp4注意:我不是使用上述URL发布视频,而是多部分/表单数据

I have fixed the posting video issue using the sample code provided here: https://developers.facebook.com/blog/post/2011/08/04/how-to--use-the-graph-api-to-upload-a-video--ios/ I don't know how long it will work as it's a deprecated code but I used the method ([FBRequestConnection startWithGraphPath:@"/me/videos") of latest v2.2 by changing API parameters : “source” to “video.mov” for video “message” to “description” for caption 我已使用此处提供的示例代码解决了发布视频的问题: https : //developers.facebook.com/blog/post/2011/08/04/how-to--use-the-graph-api-to-upload -a-video--ios /我不知道它会被使用多久,因为它已弃用,但是我通过更改API参数使用了最新v2.2的方法([FBRequestConnection startWithGraphPath:@“ / me / videos”) :“源”到“ video.mov”以获得视频,“消息”到“描述”获得字幕

Now I have one more issue: I need to tag friends from my app. 现在,我还有一个问题:我需要从我的应用中标记朋友。 I use /{photo-id}/tags for tagging a photo which is working fine and I tried the same API to tag a video as I'm not able to get any other API from FB docs. 我使用/ {photo-id} / tags标记可以正常工作的照片,我尝试使用相同的API标记视频,因为我无法从FB文档获得任何其他API。 I get the below error for while tagging friends for a video: 在为朋友标记视频时,出现以下错误:

{
body =     {
    error =         {
        code = 100;
        message = "(#100) The parameter tag_uid is required";
        type = OAuthException;
    };
};
code = 400;
}

Is there any API to tag a video from mobile app? 是否有API可以标记来自移动应用的视频?

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

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