Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is another answer for this question. We can have pre-installed facebook application to our mobile device , but we will not be interacting with the already installed application,i.e. we will not use single sign on ,better known as SSO(though it is recommended to use). We are having this method in facebook sdk. single sign-on may be disabled by passing FORCE_DIALOG_AUTH as the activityCode parameter in your call to authorize().</p> <pre><code>public void authorize(Activity activity, String[] permissions, int activityCode, final DialogListener listener) </code></pre> <p>Here the third parameter plays the role i.e. activityCode.Now lets see its role</p> <pre><code> if (activityCode &gt;= 0) { singleSignOnStarted = startSingleSignOn(activity, mAppId, permissions, activityCode); } // Otherwise fall back to traditional dialog. if (!singleSignOnStarted) { startDialogAuth(activity, permissions); } </code></pre> <p>It means if we want to be untouched with the pre installed facebook application we have to pass activityCode with less than 0 (&lt; 0) value.Now in your main activity where facebook api is called use</p> <pre><code>int FORCE_DIALOG_AUTH =-1; mFacebook.authorize(this, new String[] { "publish_stream", "read_stream", "offline_access", "friends_birthday", "user_birthday", "email", "read_friendlists", "manage_friendlists" },FORCE_DIALOG_AUTH , new LoginDialogListener()); </code></pre> <p>If we would like to force the use of legacy dialog-based authorization, pass FORCE_DIALOG_AUTH for this parameter. Otherwise just omit this parameter and Facebook will use a suitable default. It was just to solve the problem from SSO.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload