Facebook, setReadPermissions and setPublishPermissions

Hey, I'm trying to use two different types of permissions.

When I use only one, everything works fine.

But when I use both of them, the application crashes:

LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton); authButton.setReadPermissions(Arrays.asList("friends_games_activity")); authButton.setPublishPermissions(Arrays.asList("publish_actions")); 

How can I add 2 permissions ( friends_games_activity and publish_actions ) without problems?

+6
source share
1 answer

You cannot have both permissions in SDK 3.0, you need to separate them. First you can open a session for reading, get what you want, and then open ForPublish.

Note. In the new SDK, you can only request read permissions when you first open a session. You should not ask your user to publish permissions until they actually post the activity on Facebook. This increases user confidence, as well as the likelihood that your user will select publications from your application. To request additional permissions, use Session.openForRead or Session.openForPublish.

You need to call clearPermissions. Described here is http://developers.facebook.com/docs/reference/android/3.0/LoginButton/#setReadPermissions(List)

+10
source

All Articles