开发者

How can I manage facebook permission in Android

开发者 https://www.devze.com 2023-03-23 11:01 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号