I'm using Firebase UI Sign In and trying to implement Facebook sign in into my android app. When launching the firebase ui activity I get:
"java.lang.IllegalStateException: Facebook provider unconfigured. Make sure to add a facebook_application_id
string"
In my string resources I have added it, this is how it looks: By the way in the firebase docs the string names are different from the ones in the facebook docs, this is how they look in the facebook docs or also called quickstart:
`<string name="facebook_app_id" translatable="false">SOMECODE</string>
<string name="fb_login_protocol_scheme"
translatable="false">SOMECODE</string>`
This is how it looks in the firebase docs:
<string name="facebook_application_id"
translatable="false">YOUR_APP_ID</string>
<string name="facebook_login_protocol_scheme"
translatable="false">fbYOUR_APP_ID</string>
I was also having some merging problem and fixed it by adding tools:replace="android:value"
to the metadata and yes everything was added inside the application tags
<meta-data android:name="com.facebook.sdk.ApplicationId"
tools:replace="android:value"
android:value="@string/facebook_app_id"
/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<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>
I don't know what's causing these problems but I think it has something to do with the string names, if anyone can help me please I will immensely appreciate it. Thank you!
Use this is AndroidManifest.xml
and in strings.xml
Add Facebook Provider in Manifest as mentioned here.
Append your app id to the end of the authorities value. For example if your Facebook app id is 1234, the declaration looks like:
Alright I was thinking that the strings provided by firebase and the ones provided by facebook where the same and I had to have only a pair of them, the truth is that they are different and add the ones provided by firebase and facebook to your string resources, that will solve the problem.