gpt4 book ai didi

ios - 使用忽略所有参数的 Facebook 消息对话框发送链接

转载 作者:可可西里 更新时间:2023-11-01 03:17:36 24 4
gpt4 key购买 nike

我正在尝试通过 v2.0 中实现的新 Facebook 消息对话框与 friend 分享/发送链接。

我一直在遵循文档的指示: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);
}
}];

和这个:(应该是同一件事)

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);
}
}];

这两种方法都会打开我的 Facebook Messenger 应用程序,对话框中预先填充了我的参数。但是当我发送消息时,除了链接之外的所有内容在接收者端都消失了。

据我了解,用户不必通过应用程序登录就可以从 Facebook 消息对话框发送消息。

有人知道这里发生了什么吗?这是 Facebook 错误吗?

编辑:这已被确认为 facebook 错误:https://developers.facebook.com/bugs/1547232035503916

最佳答案

虽然这个bug在2014年6月被修复了,但是使用最新的Facebook示例代码还是有可能出现类似的问题。在最新的示例“FBShareSample”和 Facebook“在 iOS 中共享”文档中,他们使用了该方法

[FBDialogs presentShareDialogWithLink:....] 

它只使用参数中的链接而不使用其余参数(尽管回退示例 Feed Dialog 实际上确实使用了所有参数)。为了使用共享对话框中的所有参数,您需要使用

[FBDialogs presentShareDialogWithParams:...]

关于ios - 使用忽略所有参数的 Facebook 消息对话框发送链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23808412/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com