0

I don't known why it occurred which it was public to everyone last week.But today when I test again,it showed me a lock and said only me in Facebook on the right of the post.

I have searched this issue in stackoverflow,found some method to change it manually. But it did not worked.

someone said to change the privacy setting:Apps > Your_APP_NAME > Settings > Permissions > Default Activity Privacy.

someone said to change in the code to set the audience:

authButton.setDefaultAudience(SessionDefaultAudience.EVERYONE);

Thanks for any tips.

1 Answers1

0

I think I have resolved this problem.

Don't use LogginButton to log in when you want to post. To use this code below to log in:

session = new Session(this);
Session.setActiveSession(session);
session.openForPublish(new Session.OpenRequest(this)
                    .setCallback(statusCallback)
                    .setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO)
                    .setPermissions(Arrays.asList("publish_actions")));

Note: It is openForPublish not openForRead.And then set the permission.