检查发布到 Facebook feed 是否成功
在我的应用程序中,用户可以发布到他的 Facebook feed,我需要知道发布是否成功。在 Facebook 开发者页面上,我发现如果帖子成功,应用程序会收到一个 post_id
。所以我可以检查这个 post_id
;如果不是nil
,这意味着用户已发布到他的提要,但我如何获取post_id
?
In my app user can post to his facebook feed, and I need to know whether the posting was successful or not. On the Facebook developers' page, I found that if a post is successful, the app receives a post_id
. So I can check this post_id
; if it is not nil
this means the user has posted to his feed, but how can I get the post_id
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我用了一些更简单的东西:
I used something a little simpler:
当墙柱对话框出现时,用户有 3 个选项。跳过、发布和取消(右上角的小“x”)。这是您可以期待的。
下面描述的这些方法是 FBDialogDelegate 协议的一部分。
对话框调用dialogCompleteWithUrl:方法,然后调用dialogDidComplete:方法
SKIP -
当用户点击“跳过”时,传递给dialogCompleteWithUrl:方法的url是
发布 -
当用户点击发布时,传递给dialogCompleteWithUrl:方法的url是
其中“123456789_12345678912345678”是用户帖子唯一的帖子 ID(也就是说,此 post_id 只是一个示例)。为了更好的解释post_id,post_id参数由userIdentifier和postIdentifier组成。
取消 -
当用户点击取消时,对话框调用dialogCancelWithUrl:方法,然后调用dialogCancel:方法。在下面的示例中,我没有对这个调用执行任何操作。
*由于除了确定是否存在来验证帖子是否成功之外,我没有将 post_id 用于任何其他用途,因此下面是如何区分这两个结果的示例。这只是一个示例,旨在帮助您查看上述结果。请随意添加您的演绎*
There are 3 options a user has when the wall post dialog is present. Skip, Publish & Cancel (the little 'x' at on top right).. Here is what you can expect.
These methods described below are part of the FBDialogDelegate Protocol.
The dialog calls dialogCompleteWithUrl:method and then it calls the dialogDidComplete:method
SKIP -
When the user taps Skip, the url that is passed to the dialogCompleteWithUrl:method is
PUBLISH -
When the user taps Publish, the url that is passed to the dialogCompleteWithUrl:method is
where "123456789_12345678912345678" is the post id unique to the user's post (meaning, this post_id is just an example). To better explain the post_id, the post_id parameter consists of userIdentifier and the postIdentifier.
CANCEL -
When the user taps on the Cancel the dialog calls the dialogCancelWithUrl:method, then the dialogCancel:method. I am not doing anything with this call in the example below.
*Since I am not using the post_id for anything except to determine if one is present to validate the success of the post, below is an example of how to differentiate the two results. This is just an example, to assist you in seeing the results as described above. Feel free to add your rendition*