ali
ali

Reputation: 11

How can I manage facebook permission in Android

I'm studying on an android app with using facebook api. I have two activity, first one is to select friends and second one is to send somethings friends wall . I'm getting permission in first activiy but second activity is also requires permission . How can I make first permission in second activity , too .

Is it suitable doing facebook object static?

Upvotes: 1

Views: 1016

Answers (2)

Khalid Alsaydabi
Khalid Alsaydabi

Reputation: 1

Peace be upon you,

Acquiring friends' info requires curtain permissions. e.g.

session.requestNewReadPermissions(new NewPermissionsRequest(FacebookLogin.this, Arrays.asList("friends_birthday", ...)));

However, publishing requires different permissions. e.g. session.requestNewPublishPermissions(new NewPermissionsRequest(FacebookLogin.this, Arrays.asList("publish_actions")));

I recommend that you ask for permissions on need basis. e.g. by adding permission request command in the implementation of a Button.

Upvotes: 0

sparkymat
sparkymat

Reputation: 10028

Permissions are associated with a particular Facebook App (you pass the App ID and App Key to the Android Facebook SDK). Hence, if you use the same Facebook App details in both activities, they both will be having the same permissions.

Upvotes: 2

Related Questions