分享Facebook无法编辑文本

时间:2014-05-08 19:21:44

标签: ios objective-c facebook sprite-kit

我创建了一个我有分享按钮的游戏。在此共享按钮中,我想分享文本和链接。重要的是用户不能编辑文本,因为他们能够改变分数。什么是最好的解决方案?我已经搜索了,但在大多数指南中,您都可以更改用户的文字。

解决方案是什么?

1 个答案:

答案 0 :(得分:4)

简短的回答是,您不应该代表用户发布内容而不给他们编辑评论/状态的选项。您可以使用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

另一个选项(尽管也可能违反规则)是从文本创建图像并让用户共享图像。然而,在做这件事之前,把自己放在用户的鞋子里 - 你真的需要发布这样的东西吗?