Alexis Wilke
Alexis Wilke

Reputation: 20725

How do I get the "publish_actions" permission to work with the JavaScript Facebook API?

I have an application and am trying to connect with:

FB.login(statusChangeAfterLogin,
            { scope:"public_profile,email,user_friends,publish_actions" });

However, it looks like the publish_actions gets totally ignored.

That is, our application is able to get the public profile information, the email, and user friend list, but it is not able to share a dynamically generate image.

I tried to break the login in two steps as in:

// first login when initializing (no publish_actions)
FB.login(statusChangeAfterLogin,
            { scope:"public_profile,email,user_friends" });

// second login when user is ready to share (just publish_actions)
FB.login(statusChangeAfterLogin,
            { scope:"publish_actions" });

However, it looks like the second action does absolutely nothing.

I'm not able to understand why I am supposed to do to allow the sharing without first having the publish_actions in the scope. I can see that it appears in the list of GET variables and includes all the parameters as expected, but the second login just opens a popup, close it, and done.

Upvotes: 0

Views: 3143

Answers (1)

andyrandy
andyrandy

Reputation: 73984

All the other permissions don´t need review, but publish_actions does. I assume you are not trying as a user with a role in the App. Read about Login Review: https://developers.facebook.com/docs/facebook-login/review

publish_actions only works for users with a role in the App, you need to go through the review process in order to make it available for everyone else.

Upvotes: 3

Related Questions