I\'ve built an activity that uses this implementation (see the accepted answer) to post a status update on a user\'s facebook wall.
It works with no problem if the e
I have found a workaround but it is not the best so far.
facebook.authorize(activity, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH,
new LoginDialogListener());
This will force that your app does not use the SSO if official facebook app is installed on the device. But there must be a better solution because there are apps out there which use sso with the official facebook app.
private static final String[] PERMISSIONS =
new String[] {"publish_stream", "read_stream", "offline_access"};
@Override
public void onClick(View v)
{
if (v == facebookPostButton)
{
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
mAsyncRunner.request(mFacebook.logout(getApplicationContext()), new LogoutListener());
mFacebook.authorize(FacebookImplement.this, PERMISSIONS, new AuthorizeListener());
}
}
public class AuthorizeListener extends BaseDialogListener {
public void onComplete(Bundle values) {
Bundle params = new Bundle();
params.putString("message"," Message");
params.putString("description", "Wall Posting Description");
mAsyncRunner.request("me/feed", params, "POST",
new UploadListener());
}
}
public class UploadListener extends BaseRequestListener {
public void onComplete(final String response) {
mAsyncRunner.request(mFacebook.logout(getApplicationContext()), new LogoutListener());
}
}
public class LogoutListener extends BaseRequestListener {
public void onComplete(final String response) {
}
}
May be this code helps you. If there is any problem then ask without any issue.
It is because when you logged in the facebook account then your login session is created in the device. You have to logout from the facebook after doing your task.