如何从iOS SDK中的Facebook对象获取Facebook用户ID?

问题描述:

我看到访问令牌在Facebook对象中可用,但我没有看到Facebook用户ID。

I see that the access token is available in the Facebook object, but I don't see a Facebook user Id.

我可以发出图形请求我获得Facebook ID,但我不想再拨打额外的api电话。

I could make a graph request to "me" to get the Facebook Id, but I'd prefer not to make the extra api call.

你将不得不打电话给我/获取身份证。 iOS访问令牌现在已加密,因此您无法从中解析用户ID。此外,服务器端令牌也将很快用oauth 2.0加密。

You will have to call /me to get the id. iOS access tokens are now encrypted and thus you won't be able to parse the user id from it. Also, server side tokens will all be encrypted with oauth 2.0 soon too.