0

Any one have the experience to get events of user using Facebook SDK 5?

I am trying to get event like

$response = $fb->get('/me',$accessToken);
$userNode = $response->getGraphEvent();

No data is returned.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
Shakir Blouch
  • 187
  • 1
  • 5
  • 14

1 Answers1

0

/me returns basic information of a User, it´s not related to events. In order to use /me, you need to authorize a User with Facebook Login: https://developers.facebook.com/docs/facebook-login

User events: https://developers.facebook.com/docs/graph-api/reference/user/events/ (You would need the user_events permission for that)

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • thank you for your answer . It's help full . Can you please give me any example to fetch user's events after getting user_events permission from user . – Shakir Blouch Feb 14 '16 at 18:10
  • there is example code in the docs, just open the last link in my answer. just use the /me/events endpoint. – andyrandy Feb 14 '16 at 18:19
  • thank for your help , Can you please give me some more detail about "user_events needs to get approved by Facebook before it works with any user, else it will only work for users with a role in your app" I read your comment form another question "http://stackoverflow.com/questions/27105247/cannot-get-permission-for-user-events-facebook" – Shakir Blouch Feb 14 '16 at 20:49
  • how any permission I can get approved by Facebook ? – Shakir Blouch Feb 14 '16 at 20:50
  • that is explained very well in the docs, it´s called "login review": https://developers.facebook.com/docs/facebook-login/review – andyrandy Feb 14 '16 at 21:09