我正在创建FBSDKShareLinkContent对象并将其提供给FBSDKShareDialog。我试图将对话框的默认消息设置为"我的高分是%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()];
答案 0 :(得分:10)
无法使用SDK提供的共享对话框设置默认消息。它也被认为是预先填写,并且违反Facebook平台政策,请参阅第2.3节https://developers.facebook.com/policy
答案 1 :(得分:1)
我发现标题和描述无论如何都与url对象有关。这意味着对象上方的消息文本,用户在共享对话框中看到的内容似乎不会受到影响。
只有将对话框模式设置为Native或FBSDKShareDialogModeFeedBrowser时,URL对象的标题和描述才有效。
dialog.mode = FBSDKShareDialogModeNative;
if (![dialog canShow]) {
dialog.mode = FBSDKShareDialogModeFeedBrowser;
}
另一件事是,FBSDKShareLinkContent的某些属性称为“quote”,它在URL对象上方和消息本身下方显示一些文本,但不会在所有模式下显示。例如,不在Native中,但在FBSDKShareDialogModeFeedBrowser中是。
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://www.x.com"];
content.contentDescription = @"desc";
content.contentTitle = @"title";
content.quote = @"quote";