Android Facebook authorization - can not log in when official Facebook app is installed

后端 未结 4 1462
予麋鹿
予麋鹿 2020-11-29 12:03

I need to log in to Facebook and get same fields like email, etc. I use the Facebook SDK, and I set my Android key Hash in developers.facebook and set \"Configured for Andro

4条回答
  •  广开言路
    2020-11-29 12:44

    I had the same problem like you. Finally, I solved using this:

    Open Facebook.java provided by the Facebook SDK and then change it like this:

    public void authorize(Activity activity, String[] permissions,
                          int activityCode, final DialogListener listener) {
        boolean singleSignOnStarted = false;
    
        mAuthDialogListener = listener;
    
        /*
        // Prefer single sign-on, where available.
        if (activityCode >= 0) {
            singleSignOnStarted = startSingleSignOn(activity, mAppId,
                                                    permissions, activityCode);
        }
        // Otherwise fall back to the traditional dialog.
        if (!singleSignOnStarted) {
        */
    
        startDialogAuth(activity, permissions);
    
        // }
    }
    

提交回复
热议问题