在Facebook Graph API中获取用户App-Scoped用户ID

问题描述:

在新的V2 Facebook Open Graph API出现之际,我需要注意登录用户的App-Scoped用户ID,以便使用Parse注册该ID以便接收PUSH通知。

In advent of the new V2 Facebook Open Graph API, I need to make note of the logged in users 'App-Scoped' user ID, in order to register the id with Parse in order to receive PUSH notifications.

但是,作为登录的用户,我得到了Facebook ID。

However, as the logged in user I get the Facebook ID instead.

在文档中没有找到任何内容解决这个问题,所以以为我最好在这里问。

Haven't found anything in the docs to solve this problem yet, so thought I better ask here.


  1. 在引入graph API 2.0之前,它将继续收到规范的facebook用户ID

  2. 如果您创建了Facebook应用程序,则在引入graph API 2.0之后,它会提供应用程序作用域ID而不是规范的id。

在这种情况下,我认为你的应用程序是相当老的。为了创建一个新的应用程序,它会给你应用范围ID。

In this case I assume your application is quite old.Therefor create a new app and it will give you the app scope id.