LopezAgrela
LopezAgrela

Reputation: 568

Permissions en SDK Facebook 3.0

I am using the new SDK Facebook 3.0. I know that when I want to request permissions (no basic), I have to set it in the LoginButton like that:

 signInFBButton.setReadPermissions(Arrays.asList("email"));

But I don't know how to do that when I don't use the LoginButton. I am using openActiveSession() in order to open the session, but I have to take the e-mail and I don´t know how to do that without LoginButton.

Any help?

Thanks.

Upvotes: 0

Views: 81

Answers (1)

Ming Li
Ming Li

Reputation: 15662

Create a Session.OpenRequest (it uses the builder pattern).

Session.OpenRequest openRequest = new Session.OpenRequest(this);
openRequest.setPermissions(...)
           .setCallback(...);

then create a new Session and set it as the active session

Session session = new Session(this);
Session.setActiveSession(session);

finally, open the session you just created

session.openForRead(openRequest); 

Upvotes: 1

Related Questions