iOS: FBSDKShareDialog 自定义消息

iOS: FBSDKShareDialog custom message

我正在创建 FBSDKShareLinkContent 对象并将其提供给 FBSDKShareDialog。我正在尝试将对话框的默认消息设置为 "my highscore is %d !" 之类的内容。共享本身正在运行,默认情况下有一条空消息。有人可以帮忙吗?

谢谢!

编辑:这是我的一段代码:

FBSDKShareLinkContent* content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString: @"https://itunes.apple.com/us/app/cylinder-game"];
content.contentTitle = @"Cylinder Game";
content.contentDescription = @"Cylinder Game is endless, rhythm based game with super addictive gameplay";

FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
[dialog setMode:FBSDKShareDialogModeAutomatic];
[dialog setShareContent:content];
[dialog setDelegate:self];
[dialog setFromViewController:UnityGetGLViewController()];

无法使用 SDK 提供的共享对话框设置默认消息。它也被视为预填充,并且违反 Facebook 平台政策,请参阅第 2.3 节 https://developers.facebook.com/policy

我发现标题和描述与 url object 相关。这意味着用户在共享对话框中看到的 object 上方的消息文本似乎不会受到影响。

并且 URL object 的标题和描述仅在您将对话模式设置为 Native 或 FBSDKShareDialogModeFeedBrowser 时有效。

dialog.mode = FBSDKShareDialogModeNative;
if (![dialog canShow]) {
    dialog.mode = FBSDKShareDialogModeFeedBrowser;
}

另一件事是,有一些 属性 的 FBSDKShareLinkContent 称为 "quote",它在 URL object 上方和消息本身下方显示一些文本,但它不是在所有模式下显示。例如不在 Native 中,但在 FBSDKShareDialogModeFeedBrowser 中是。

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://www.x.com"];
content.contentDescription = @"desc";
content.contentTitle = @"title";
content.quote = @"quote";