“签名不正确”来自 FBVideoUpload 请求
通过 FBConnect 上传视频时,我收到“签名不正确”错误(版本位于 https:// /github.com/zoul/facebook-ios-sdk/)。见下文。
有什么想法如何调试这个吗?
是否有通过 FBConnect 上传视频的工作示例?
任何建议将不胜感激。
代码:
NSArray *permissions = [NSArray arrayWithObjects:@"publish_stream", @"offline_access",nil];
_facebook.forceOldStyleAuth = TRUE;
[_facebook authorize:APP_ID permissions:permissions delegate:_facebookDelegate];
...
NSString *path = [[NSBundle mainBundle] pathForResource:@"dreamall" ofType:@"m4v" inDirectory:@"/"];
NSURL *url = [NSURL fileURLWithPath:path];
FBVideoUpload *upload = [[FBVideoUpload alloc] init];
upload.accessToken = _facebook.accessToken;
upload.apiKey = API_KEY;
upload.appSecret = SECRET;
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"test", @"title",
@"upload testing", @"description",
nil];
[upload startUploadWithURL:url params:params delegate:self];
响应:
<error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">
<error_code>104</error_code>
<error_msg>Incorrect signature</error_msg>
<request_args list="true">
<arg>
<key>description</key>
<value>upload testing</value>
</arg>
<arg>
<key>v</key>
<value>1.0</value>
</arg>
<arg>
<key>api_key</key>
<value>...</value>
</arg>
<arg>
<key>method</key>
<value>facebook.video.upload</value>
</arg>
<arg>
<key>session_key</key>
<value>41ab9717c61b70a34a8e48d4.3-100000419172530</value>
</arg>
<arg>
<key>sig</key>
<value>bca612d495400136f1847f2bc6907525</value>
</arg>
<arg>
<key>title</key>
<value>test</value>
</arg>
</request_args>
</error_response>
í£|<€_Y†gÊˇ¯ZÓzì&Àle4:∫Ù6V-Fn#vÂΩ'‚¥gƒ˙Y†ˇOáeyœn,≠ˇŒX≤Ÿ˘¡¬6G˛éÊ]÷FùC¯7˘JêÁW˙∫nÂfi${(;∑.L‰¯õßÏAüˆ—6Û{ˆhu|ûfi± •ìn£hfiÇç£÷¥GÃ…˛Ü·B:up
I'm getting an "Incorrect signature" error when uploading a video through FBConnect (version at https://github.com/zoul/facebook-ios-sdk/). See below.
Any ideas how to debug this?
Is there a working example for uploading a video through FBConnect?
Any suggestions would be appreciated.
The code:
NSArray *permissions = [NSArray arrayWithObjects:@"publish_stream", @"offline_access",nil];
_facebook.forceOldStyleAuth = TRUE;
[_facebook authorize:APP_ID permissions:permissions delegate:_facebookDelegate];
...
NSString *path = [[NSBundle mainBundle] pathForResource:@"dreamall" ofType:@"m4v" inDirectory:@"/"];
NSURL *url = [NSURL fileURLWithPath:path];
FBVideoUpload *upload = [[FBVideoUpload alloc] init];
upload.accessToken = _facebook.accessToken;
upload.apiKey = API_KEY;
upload.appSecret = SECRET;
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"test", @"title",
@"upload testing", @"description",
nil];
[upload startUploadWithURL:url params:params delegate:self];
The response:
<error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">
<error_code>104</error_code>
<error_msg>Incorrect signature</error_msg>
<request_args list="true">
<arg>
<key>description</key>
<value>upload testing</value>
</arg>
<arg>
<key>v</key>
<value>1.0</value>
</arg>
<arg>
<key>api_key</key>
<value>...</value>
</arg>
<arg>
<key>method</key>
<value>facebook.video.upload</value>
</arg>
<arg>
<key>session_key</key>
<value>41ab9717c61b70a34a8e48d4.3-100000419172530</value>
</arg>
<arg>
<key>sig</key>
<value>bca612d495400136f1847f2bc6907525</value>
</arg>
<arg>
<key>title</key>
<value>test</value>
</arg>
</request_args>
</error_response>
í£|<€_Y†gÊˇ¯ZÓzì&Àle4:∫Ù6V-Fn#vÂΩ'‚¥gƒ˙Y†ˇOáeyœn,≠ˇŒX≤Ÿ˘¡¬6G˛éÊ]÷FùC¯7˘JêÁW˙∫nÂfi${(;∑.L‰¯õßÏAüˆ—6Û{ˆhu|ûfi± •ìn£hfiÇç£÷¥GÃ…˛Ü·B:up
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对我来说 FBVideoUpload 工作正常,所以我把我的代码放在这里:
在 Facebook 委托方法中
For me FBVideoUpload works fine so I put my code here :
In Facebook delegate methods
我的 Facebook 应用程序未设置为“桌面”模式。这就是身份验证不起作用的原因。请参阅:
http://code.google.com/p/facebook-java -api/wiki/DesktopMode
不幸的是,他们从 Facebook 的开发者网站中删除了此选项,因此不可能让当前版本的 FBVideoUpload 与新应用程序一起使用。
我已修改 FBVideoUpload 以使用新的 Graph API 而不是旧的 REST API。见下文。我将与 FBVideoUpload 的开发人员联系。
My facebook app was not set to "Desktop" mode. That's why the authentication didn't work. See:
http://code.google.com/p/facebook-java-api/wiki/DesktopMode
Unfortunately, they removed this option from Facebook's developer site so it's not possible to get the current version of FBVideoUpload working with a new app.
I've modified FBVideoUpload to use the new Graph API instead of the old REST API. See below. I'll get in touch with the developer of FBVideoUpload.