How to get FB User ID using Facebook Login Button in android application

前端 未结 8 2520
鱼传尺愫
鱼传尺愫 2021-02-05 21:51

I\'m developing an application in which I\'m using Facebook log in button from SDK. I\'m able to get access_token of the user but I want userID

8条回答
  •  清酒与你
    2021-02-05 22:32

    After successful login, you need to call following code. You can get the logged-in user details with id in response.

    Session session = Session.getActiveSession();
    Request request = Request.newGraphPathRequest(session, "me", null);
    com.facebook.Response response = Request.executeAndWait(request)
    

提交回复
热议问题