Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook, setReadPermissions and setPublishPermissions

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

When I'm using only one, all works fine.

But when I'm using both of them the app 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 the 2 permissions (friends_games_activity and publish_actions) without problems?

like image 417
Aviram Fireberger Avatar asked Mar 31 '13 08:03

Aviram Fireberger


1 Answers

You cannot have both permissions in SDK 3.0, you need separate them. You can first open session for read, get what you want and then openForPublish.

Note: In the new SDK, you may ask only for read permissions when you first open a session. You should not prompt your user for publish permissions until the time at which they are actually publishing an action to Facebook. This increases user trust, and also the likelihood that your user will choose to publish stories from your app. To request further permissions, use Session.openForRead or Session.openForPublish.

You need to call clearPermissions. It's described here http://developers.facebook.com/docs/reference/android/3.0/LoginButton/#setReadPermissions(List)

like image 178
M G Avatar answered Oct 14 '22 10:10

M G