Pap*_*ick 8 facebook-graph-api ios facebook-messages facebook-graph-api-v2.0 facebook-sdk-3.14.x
我试图通过在v2.0中实现的新Facebook消息对话框来分享/发送给朋友的链接.
我一直在遵循文档的指示:https://developers.facebook.com/docs/ios/share#message-dialog-getting-started 这是我尝试过的:
[FBDialogs presentMessageDialogWithLink:[NSURL URLWithString:@"http://XXX.net/"] name:@"NAME" caption:@"CAPTION" description:@"DESCRIPTION" picture:nil clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog([NSString stringWithFormat:@"Error messaging link: %@", error.des
cription]);
} else {
// Success
NSLog(@"result %@", results);
}
}];
Run Code Online (Sandbox Code Playgroud)
而这:(应该是同一件事)
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:@"http://xxx.net/"];
params.name = @"NAME";
params.caption = @"CAPTION";
//params.picture = [NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/en/c/cd/Aller_Media_logo.png"];
params.linkDescription = @"DESCRIPTION";
[FBDialogs presentMessageDialogWithParams:params clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog([NSString stringWithFormat:@"Error messaging link: %@", error.description]);
} else {
// Success
NSLog(@"result %@", results);
}
}];
Run Code Online (Sandbox Code Playgroud)
这两种方法都带来了我的Facebook Messenger应用程序,其中的对话框预先填充了我的参数.但是当我发送消息时,除了链接之外的所有内容都是GONE在接收方端.
根据我的理解,用户不必通过应用程序登录,以便能够从Facebook消息对话框发送消息.
有谁知道这里发生了什么?这是一个Facebook Bug吗?
编辑:这已被确认为facebook-bug:https://developers.facebook.com/bugs/1547232035503916
小智 3
尽管这个 bug 已于 2014 年 6 月修复,但最新的 Facebook 示例代码仍有可能出现类似问题。在最新的示例“FBShareSample”和 Facebook“在 iOS 中共享”文档中,他们使用了该方法
[FBDialogs presentShareDialogWithLink:....]
Run Code Online (Sandbox Code Playgroud)
它仅使用参数中的链接,而不使用其余参数(尽管后备示例 Feed Dialog 实际上确实使用了所有参数)。为了使用共享对话框中的所有参数,您需要使用
[FBDialogs presentShareDialogWithParams:...]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3349 次 |
| 最近记录: |