Signin using facebook sdk in android when facebook app not installed issue


I have implemented login via facebook in android app and it is working fine when facebook app is installed on my device. after uninstalling the app, when hit login via facebook, it shows the facebook login screen, after granting permission for the app, it redirects me to the my login screen, but onActivityResult is not called, and I can’t click on any button in the screen. when I hit on back button, a transparent screen is closed, and onActicityResult is called with intent null.

In my gradle file I’m using the latest facebook version

implementation '

And this is the code I’m using in my activity:

 mCallbackManager = CallbackManager.Factory.create();
LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
            public void onSuccess(LoginResult loginResult) {

            public void onCancel() {
                showErrorMessage(getResources().getString(R.string.facebook_login_canceled), true);

            public void onError(@NonNull FacebookException exception) {
                showErrorMessage(exception.getLocalizedMessage(), true);

And the click event is done like following:

        LoginManager.getInstance().logInWithReadPermissions(this, mCallbackManager, Arrays.asList("public_profile", "email"));

My manifest file looks like this:

            android:label="@string/app_name" />
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="@string/fb_login_protocol_scheme" />

            android:value="@string/facebook_app_id" /> 
        <!-- [Facebook] -->
        <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>

Anyone face an issue like this?



This is a bug in Facebook’s SDK when working with AndroidX fragments / activity with version 1.5.0+

Just update your Facebook SDK to the latest version (recommended) OR downgrade your fragment / activity version (not recommended)

Answered By – jos_fzr

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published