Facebook提供商未配置.确保添加`facebook_application_id`字符串 [英] Facebook provider unconfigured. Make sure to add a `facebook_application_id` string

查看:443
本文介绍了Facebook提供商未配置.确保添加`facebook_application_id`字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase UI登录并尝试在我的android应用中实现Facebook登录.启动firebase ui活动时,我得到:

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提供程序.请确保添加facebook_application_id字符串"

"java.lang.IllegalStateException: Facebook provider unconfigured. Make sure to add a facebook_application_id string"

在我的字符串资源中,我添加了它,它看起来是这样的: 顺便说一下,firebase文档中的字符串名称与facebook文档中的字符串名称不同,这就是它们在facebook文档中的外观,也称为快速入门:

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>`

这是Firebase文档中的外观:

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>

我也遇到了一些合并问题,并通过在元数据中添加tools:replace="android:value"来解决它,是的,所有内容都添加到了应用程序标记中

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!

推荐答案

按照清单将您的应用ID附加到授权值的末尾.例如,如果您的Facebook应用ID为1234,则声明如下:

Append your app id to the end of the authorities value. For example if your Facebook app id is 1234, the declaration looks like:

<provider android:authorities="com.facebook.app.FacebookContentProvider1234"
          android:name="com.facebook.FacebookContentProvider"
          android:exported="true" />

这篇关于Facebook提供商未配置.确保添加`facebook_application_id`字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆