[英]Video post from iOS app to Facebook is not showing up on Facebook timeline
我已經在我的iOS應用中實現了圖形API POST / me / photos,並且工作正常。 我用Facebook文檔中建議的主機graph-video.facebook.com來實現/ me / videos的相同方法,並且此鏈接也是如此:[cURL- 有沒有辦法將視頻上傳到沒有格式的Facebook? 我也收到了類似的成功回復,但該視頻未顯示在我的Facebook帳戶中。
{
id = 10150481253673034;
url = "https://graph-video.facebook.com/me/videos";
}
這是我寫的代碼:
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);
}];
如果將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;
}
我嘗試使用受支持的視頻中的.mp4和.mov。 我確定視頻沒有問題,因為發布到FB之前我上傳到Amazon S3的視頻相同,我可以播放上傳的視頻。 這是一個示例: https : //tagg-social-staging.s3.amazonaws.com/uploads/posts/videos/36/post-video.mp4注意:我不是使用上述URL發布視頻,而是多部分/表單數據
我已使用此處提供的示例代碼解決了發布視頻的問題: 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”以獲得視頻,“消息”到“描述”獲得字幕
現在,我還有一個問題:我需要從我的應用中標記朋友。 我使用/ {photo-id} / tags標記可以正常工作的照片,我嘗試使用相同的API標記視頻,因為我無法從FB文檔獲得任何其他API。 在為朋友標記視頻時,出現以下錯誤:
{
body = {
error = {
code = 100;
message = "(#100) The parameter tag_uid is required";
type = OAuthException;
};
};
code = 400;
}
是否有API可以標記來自移動應用的視頻?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.