How to Solve the Problem in Deprecating Facebook Login support on Android WebViews

Facebook Login Problem Solved

Geno Tech
2 min readNov 19, 2021
Photo by Solen Feyissa on Unsplash

Since 5th October 2021, Facebook has deprecated the Facebook login via web views. This will disrupt your new users’ experience because they get an error message when they are logging in. As the solution for this problem, except embedded view(Webview), now the login button opens your default browser.

I followed the following steps to avoid this problem in my existing apps. You also can follow these steps and ensure these steps are satisfied in your applications.

Step #1

First, ensure your Facebook SDK version is 8.2.0 or later. If not, update your build.gradle(app) file as follows.

//Facebook
implementation 'com.facebook.android:facebook-android-sdk:9.0.0'
implementation 'com.facebook.android:facebook-login:9.0.0'

Step #2

Please check that you are not setting LoginBehavior=WEB_VIEW_ONLY. If it is, just remove it.

Step #3

Finally, you have to check your AndroidManifest.xml file. Please check and remove any code block having the keyword CustomTabActivity. Here I removed the following code snippet in my AndroidManifest.xml file.

<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<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" />
</intent-filter>
</activity>

Finally

After these steps are followed, your login button should redirect the login into your default browser. It means your user does not get the following error message anymore. Finally, update your app in the play store, and then newly installed and updated users will not face the following issue.

https://developers.facebook.com/docs/facebook-login/android/deprecating-webviews

Found this post helpful? Kindly tap the 👏 button below! :)

--

--

Geno Tech

Software Development | Data Science | AI — We write rich & meaningful content on development, technology, digital transformation & life lessons.