【问题标题】:Share facebook without being able to edit text在无法编辑文本的情况下共享 facebook
【发布时间】:2014-05-08 19:21:44
【问题描述】:

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

解决办法是什么?

【问题讨论】:

标签: ios objective-c facebook sprite-kit


【解决方案1】:

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

另一种选择(尽管也可能违反规则)是从文本创建图像并让用户共享图像。但是,在这样做之前,请先设身处地为用户着想——您真的需要发布类似的内容吗?

【讨论】:

  • 很多游戏都有分享功能,您可以在 Facebook 上分享您的分数?这怎么可能违反规则?
  • 根据developers.facebook.com/docs/apps/review/prefill,这是违规行为。是的,它一直在发生,但由于我展示了可用于此目的的代码,我想明确表示 Facebook 不允许这样做。您可以在服务器上发布他们的分数并分享帖子的链接(如政策页面视频中的示例所示)。
猜你喜欢
  • 1970-01-01
  • 2013-05-31
  • 1970-01-01
  • 2016-06-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多