Publish post in user feed which visible for EVERYONE

I'm using android-facebook-sdk and trying to post to user's wall. Here is my code:

Bundle params = new Bundle();

        JSONObject privacy = new JSONObject();
        try {
            privacy.put("value", "EVERYONE");
        } catch (JSONException e) {
            Log.e(TAG, "Unknown error while preparing params", e);
        }

        params.putString("message", message);
        params.putString("privacy", privacy.toString());
        facebook.request("me/feed", params, "POST");

Posted messages has privacy scope visible for friends only, but i want publish to everyone. What i do wrong?

Answers


What i do wrong?

Mainly this, I’d guess:

but i want publish to everyone.

https://developers.facebook.com/docs/reference/api/post/ says,

any non-default privacy setting must be intentionally chosen by the user. You may not set a custom privacy setting unless the user has proactively specified that they want this non-default setting.

Is this the case in your scenario?

Note that the visibility of the post will be determined by the more restrictive of the user's privacy setting as well as the post's privacy field

So if the user’s setting for what kind of privacy posts made by your app should adhere to is more restrictive than what you want to set / force while making the post, it will not work the way you want it.


Need Your Help

android.view.WindowManager$BadTokenException

android android-windowmanager

I custom notification in application by use windowmanager to addview.