通过iOS SDK将上传的Facebook视频发布到朋友的墙上 [英] Post uploaded facebook video to friend's wall via ios sdk

查看:83
本文介绍了通过iOS SDK将上传的Facebook视频发布到朋友的墙上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我采用这样的网址,就可以将视频发布到朋友墙上:

I am able to post a video to a friends wall if I take a url like this:

http://www.facebook.com/video/video.php?v=10150344412195987

,然后将其放在他们墙上的写点东西...."字段中.它确切地发布了我想要的.但是,如果我尝试使用此图通过api发布:

and put that in the "Write something ...." field on their wall. It posts exactly how I want. However if I try posting via the graph api using this:

NSString *postUrl = @"http://www.facebook.com/video/video.php?v=10150344412195987";
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                    @"post this", @"message",
                                    postUrl, @"source",
NSString *graphPath = [NSString stringWithFormat:@"me/feed"];    
FBRequest *req = [facebook requestWithGraphPath:graphPath
                                    andParams:params
                                    andHttpMethod:@"POST"
                                    andDelegate:requestDelegate];

我收到此错误:

(#100) FBCDN image is not allowed in stream: http://www.facebook.com/video/video.php?v=10150344412195987

有什么办法解决吗?我也尝试使用"link"参数代替"source",但出现此错误:

Is there any way around this? I also tried using the "link" parameter instead of "source" but then I get this error:

Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x7fabf70 {error=<CFBasicHash 0x7fa4b90 [0x273a380]>{type = mutable dict, count = 2,
entries =>
2 : <CFString 0x7facfb0 [0x273a380]>{contents = "type"} = <CFString 0x7fb4370 [0x273a380]>{contents = "OAuthException"}
3 : <CFString 0x7fb4630 [0x273a380]>{contents = "message"} = <CFString 0x7fb4a50 [0x273a380]>{contents = "An unknown error has occurred."}
}
}'

为什么我可以手动张贴到我的朋友墙上,但不能通过图形API?

Why am I able to post by hand to my friends wall but not through the graph api?

如果我可以在视频中标记用户,那将是理想的解决方案.

if I could tag a user in a video that would be the ideal solution.

推荐答案

不允许您直接上传fbcdn.net域中托管的图像/视频.这是由于没有始终对媒体进行优化而造成的限制.这就是这个错误的意思.

You are not allowed to directly upload images/videos that are hosted on the fbcdn.net domain. This is a limitation that was put in place because the media was not always optimized. That is what this error means.

如果您想查看如何将视频上传到用户的墙上,请参阅操作方法博客文章

If you want to see how to upload a video to a user's wall see the How-To blog post https://developers.facebook.com/blog/post/532/ but in your case you may want to first download the video locally before uploading it via Graph API.

NSURL *url = [NSURL URLWithString:@"http://www.facebook.com/video/video.php?v=10150344412195987"];
NSData * videoData = [NSData dataWithContentsOfURL:url];

这篇关于通过iOS SDK将上传的Facebook视频发布到朋友的墙上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆