我正在创建一个有分享按钮的游戏。在此共享按钮中,我想共享文本和链接。重要的是用户不能编辑文本,因为他们可以更改乐谱。最好的解决方案是什么?我搜索过,但在大多数指南中,您都可以作为用户更改文本。
解决方案是什么?
最佳答案
简短的回答是,您不应该代表用户发布某些内容而不给他们编辑评论/状态的选项。您可以通过 API 调用(而不是共享表)来实现,但这应该只用于发布用户在应用其他地方输入的内容。
// NOTE: pre-filling fields associated with Facebook posts,
// unless the user manually generated the content earlier in the workflow of your app,
// can be against the Platform policies: https://developers.facebook.com/policy
[FBRequestConnection startForPostStatusUpdate:@"User-generated status update."
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
// Status update posted successfully to Facebook
NSLog(@"result: %@", result);
} else {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(@"%@", error.description);
}
}];
这是来自 Facebook's "Sharing in iOS" documentation
另一种选择(尽管也可能违反规则)是从文本创建图像并让用户共享图像。然而,在这样做之前,请设身处地为用户着想——您真的需要发布这样的内容吗?
关于ios - 在无法编辑文本的情况下共享 Facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23550720/