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 ca开发者_StackOverflow中文版n I make first permission in second activity , too .
Is it suitable doing facebook object static?
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.
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.
精彩评论