Question

I'm using Facebook SDk for android for posting statuses to user's timeline and it works fine except that the posts are shared with the user's friends and not with the public which is what I need it to do. I didn't find any solution yet so I'm asking this forum.

Hope my question is clear.

Thanks a lot!

Was it helpful?

Solution

To change the privacy setting of a feed, you can add additional parameter- privacy with your /me/feed call.

JSONObject privacy = new JSONObject();
privacy.put("value", "EVERYONE");
params.putString("privacy", privacy.toString());
..... //other params
..... // make the call `/me/feed`

More details here

Please Note

A user can also manually sets the privacy of an application. To check this: go to your Facebook Settings, see what you've set your application to.

The actual privacy applied will be the more restrictive privacy setting between the two.

eg.

If the user has set "Only Me" in the facebook settings, but in app you applied "Public", then the user's preference, i.e. Only Me will be used.
But if the user has set "Public" in the app settings, but in the app you applied "Friends", then the app's setting i.e. "Friends" is used, as it's more restrictive than the User's settings.

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top