简体   繁体   中英

post on facebook group javascript SDK

I'm trying to post on facebook group using my application. If I'm write this:

FB.login(function () {
            FB.api('/me/feed', 'post', { message: 'Hello, world!' });
        }, { scope: 'publish_actions' });

I can post on my timeline. But when I'm changing me to group_id

FB.api('/group-id/feed', 'post', { message: 'Hello, world!' });

I have already take publish_actions and user_groups permitions..

I can't post on groups. How can I do that?

You forgot user_groups in the scope parameter:

FB.login(function () {
    FB.api('/[group-id]/feed', 'post', {message: 'Hello, world!'});
}, {scope: 'publish_actions, user_groups'});

See Facebook docs for more information about group posting: https://developers.facebook.com/docs/graph-api/reference/v2.1/group/feed

A user access token, for someone able to post to the group, with publish_actions and user_groups permission is required.

Keep in mind that you are not allowed to prefill the message parameter (it must be user generated), and you have to go through a review process to make those permissions available for other users: https://developers.facebook.com/docs/apps/review

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM