Vivendi
Vivendi

Reputation: 21067

Get application permissions of user

I have a facebook application (a two player game) that can post messages on the wall of a friend. This all works. But when the user opens the app for the first time he gets a message asking him if he allows the application to post messages on his wall.

Obviously some users will press the "Don't allow" button.

Is there a way to check the permissions that my ap has with a certain user? So i know wether or not to call the facebookClient.Post() method.

I'm using the C# FacebookClient library. So if possible i'd like a solution for that.

Upvotes: 0

Views: 631

Answers (1)

Nitzan Tomer
Nitzan Tomer

Reputation: 164367

Yes, of course, there's the permissions connection for the User object, and you don't need any special permission for asking that.

You can ask about the logged in user "me/permissions" or by user id "USER_ID/permissions", which will return:

array containing a single object which has the keys as the permission names and the values as the permission values (1/0) - Permissions with value 0 are omitted from the object by default

You can try it with the Graph Explorer.

I have no idea about the C# part, but since all facebook SDKs are simply wrappers for https requests, I'm sure it's possible. Basically, if you can get results for "/me" then you should be able to get results for "/me/permissions".

Upvotes: 1

Related Questions