facebook / facebook-android-sdk

Used to integrate Android apps with Facebook Platform.
https://developers.facebook.com/docs/android
Other
6.16k stars 3.65k forks source link

Android FB SDK login - opens external browser though the FB app is installed #1156

Open dominolog opened 1 year ago

dominolog commented 1 year ago

Checklist before submitting a bug report

Java version

1.8

Android version

11

Android SDK version

33

Installation platform & version

Gradle

Package

Login

Goals

Facebook login to our app

Expected results

FacebookCallback to be called with LoginResult

Actual results

My Android app integrates FB SDK login. I am calling

LoginManager.getInstance().logIn

On one device even if the FB app is installed, the login flow from my app does not open FB app but instead it fires an external browser with login. If I enter credentials there, there is an error saying “Logging in to Facebook from an embedded browser is disabled” What may be the reason?

Steps to reproduce

No response

Code samples & details

My Android app integrates FB SDK login. I am calling

`LoginManager.getInstance().logIn`

On one device even if the FB app is installed, the login flow from my app does not open FB app but instead it fires an external browser with login. If I enter credentials there, there is an error saying “Logging in to Facebook from an embedded browser is disabled” What may be the reason?
dominolog commented 1 year ago

Anybody?

dominolog commented 1 year ago

IMG-20230115-WA0000

luosu1025769919 commented 1 year ago

can check manifest.xml,zhis code is add?

dominolog commented 1 year ago

Yes, this section is in manifest

`

</queries>`

as well as

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

And <activity android:name="com.facebook.FacebookActivity" android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />

gkielwasser commented 1 year ago

I'm experiencing the same thing but in a specific condition.

I will have the same behavior in case I'm logged in the Facebook app AND I'm switched to a page profile in the Facebook app. In this case I will have the same error unless the next procedure is done.

The only way to resolve is to logout the Facebook app first. In this case sign in it will work without using the webview that is failing.

In case I go to Facebook app and I switch to a page profile, it won't work again.

version com.facebook.android:facebook-login:14.1.0