Facebook, setReadPermissions and setPublishPermissions

13,642

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)

Share:
13,642
Aviram Fireberger
Author by

Aviram Fireberger

Currently Software Engineer at Amazon. Working in Lab126 group which specialize with computer vision analysis. Building a full end to end working POCs to demonstrate how the new algorithms that we developed can help and interact with the users. Designing and implementing scaled distributed system based on AWS services, for more mature POCs that later developed into a full ongoing product. Self Employ (During my spare time), Game developer (Native Android & Unity). Have a great enthusiasm for games development. Some of my games can by found in the Google-Play store: https://play.google.com/store/apps/developer?id=AVRUM

Updated on June 20, 2022

Comments

  • Aviram Fireberger
    Aviram Fireberger almost 2 years

    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?