简体   繁体   English

如何使用Android和Graph API获取Facebook个人资料ID?

[英]How do I get the Facebook profile id using Android and Graph API?

How do I get a profile id of a Facebook profile to which I have logged in through my Android application? 如何获取我通过Android应用程序登录的Facebook个人资料的个人资料ID?

I have been able to log in to Facebook using the Android and Graph API, but I want to fetch the profile ID of the specific Facebook profile to which I have logged in. 我已经能够使用Android和Graph API登录Facebook,但我想获取我登录的特定Facebook个人资料的个人资料ID。

Please help me solve this problem. 请帮我解决这个问题。 I am new to Android and the Facebook Graph API. 我是Android和Facebook Graph API的新手。 I have searched a lot, but I didn't find any workaround to this. 我搜索了很多,但我没有找到任何解决方法。

The Facebook graph API lets you make calls that return JSON, which you can parse in Android with a JSONObject . Facebook图形API允许您进行返回JSON的调用,您可以使用JSONObject在Android中进行解析。

Facebook fb = new Facebook(API_KEY);
// ... login user here ...
JSONObject me = new JSONObject(fb.request("me"));
String id = me.getString("id");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Android图形API获取Facebook个人资料图片更新时间 - Get facebook profile picture update time using graph api for android 如何使用Graph API获取用户朋友的个人资料ID - How to get profile Id of user's friends using Graph API 如何从Facebook图形api获取相册ID? - How do I get album id's from the Facebook graph api? 如何获得 Facebook stream 和 Android 上的用户配置文件? - How do I get a Facebook stream and user profile on Android? 如何在Android中使用Google People API获取Connections的配置文件ID? - How to get profile ID of Connections using Google People API in Android? 如何从Android Facebook Graph-API获取个人资料大图 - How to Get profile large image from Android Facebook Graph-API 如何使用Facebook Graph Api获取所有与这些给定位置ID相同的Facebook公共事件? - How can I get all Facebook public events those locations ids are same to the specific given location id using Facebook Graph Api? 如何使用 Graph API for android 获取 facebook 用户的位置 - how to get location of facebook user using Graph API for android 如何使用Graph API或FQL重新获取Facebook个人资料图片评论 - How To Retrive Facebook Profile Picture Comments using Graph API or FQL 如何使用Graph api识别Facebook用户是否有个人资料照片? - How to identify if Facebook user has Profile Photo or Not using Graph api?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM