不允许全局ID。请使用特定于应用程序的ID [英] The global ID is not allowed. Please use the application specific ID instead

查看:95
本文介绍了不允许全局ID。请使用特定于应用程序的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Graph API 2.0中

In Graph API 2.0

当我使用新的图形API访问我的朋友的信息时,我收到了以下消息。

When I using new graph api to access my friends information, I got the message below.

这里,xxx是一个用户ID。

Here, xxx is an user id.

{
  "error": {
    "message": "The global ID xxx is not allowed. Please use the application specific ID instead.", 
    "type": "OAuthException", 
    "code": 2500
  }
}

什么是应用程序的特定ID?
至少,文档中没有什么。
(如果我使用Graph API 1.0,一切都会很好。)

What's application specific ID? At least, there's nothing in the docs about that. (If I use Graph API 1.0, everything will be fine.)

推荐答案

这是摘自一篇博文我写了关于这个主题的答案,你的问题: / p>

Here's an excerpt from a blog post I wrote on this topic that answers your question:


在v1.0的更简单的日子里,当Graph API在用户上报告时,它提供的id值是一个全局id号码那个Facebook用户。这些值是全局,它们可以在客户端应用程序之间共享。在v2.0中,由 / user 端点及其子项提供的所有用户数据都使用特定于应用程序的ID。这些ID不仅是Facebook用户,而且是客户端 - 用户对的唯一标识符。这意味着您不能在应用程序之间共享用户ID。 (虽然Facebook确实提供API ,用于在单一组织的应用程序之间进行映射。)

In the simpler days of v1.0, when the Graph API reported on a user, the id value it provided was a global id number for that Facebook user. These values were "global" in the sense that they could be shared between client applications. In v2.0, all user data provided by the /user endpoint and its children use application-specific ids. These ids are a unique identifier not just of the Facebook user, but of the client-user pair. This mean that you can’t share user ids between applications. (Though Facebook does provide an API for mapping between applications that are part of single organization.)

这个事实的一个重要后果是您用于开发的Facebook应用程序识别的用户ID与您的生产应用程序识别的用户ID不匹配。因此,如果您将用户的Facebook ID存储在生产中的数据库中,则无法使用该API中的返回数据与该数据库中的用户进行匹配。这很讨厌!

An important consequence of this fact is that the user ids recognized by the Facebook applications you use for development will not match the ones your production app recognizes. So, if you store your users’ Facebook ids in your database in production, you won’t be able to match up users in that database with data returned from the API in development. That’s annoying!

而且没有办法。您只需要从开发应用程序中查询您的几个朋友,并手动覆盖其存储的开发数据库中的Facebook ID。这将给你几个例子来开发。

And there’s no way around it. You’ll just have to query for a few of your friends from the development app and manually overwrite their stored Facebook ids in your development database. This will give you a few exemplars to develop against.

这篇关于不允许全局ID。请使用特定于应用程序的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆