我正在尝试使用firebaseUI添加基于Facebook的登录,但它无法正常工作。 MainActivity的要点是gist 用于显示基于fb的登录的代码是
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setProviders(
AuthUI.FACEBOOK_PROVIDER,
AuthUI.EMAIL_PROVIDER,
AuthUI.GOOGLE_PROVIDER)
.build(),
RC_SIGN_IN);
我已将应用ID添加到字符串的.xml
<string name="facebook_app_id" translatable="false">XXXXXXXXXXXXXX</string>
<string name="fb_login_protocol_scheme">fbXXXXXXXXXXXXXXXXX</string>
以下是登录时发生的事情的视频。 https://www.youtube.com/watch?v=5PiCFiY3GH8
我在互联网上搜索了很多,但无法解决这个问题。 类似的堆栈溢出问题但没有解决方案
FirebaseUI authentication with Facebook not working
下面是我看到的logcat。
01-01 15:44:30.126 1563-1633/? I/ActivityManager: Displayed com.google.firebase.udacity.friendlychat/com.facebook.FacebookActivity: +248ms
01-01 15:44:31.189 4811-14350/? W/fb4a.BlueServiceQueue: Exception during service
X.2Oo: [code] 100 [message]: invalid app id (100) [extra]: null
at X.11M.a(:172024)
at X.1pN.j(:329316)
at X.2R7.a(:409495)
at X.159.handleResponse(:180125)
at com.facebook.tigon.httpclientadapter.TigonHttpClientAdapterImpl$ClientCallbacks$1.run(:327964)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at com.facebook.common.executors.WrappingExecutorService$1.run(:77498)
at com.facebook.common.executors.DefaultConstrainedListeningExecutorService$Worker.run(:63229)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.facebook.common.executors.NamedThreadFactory$1.run(:77690)
at java.lang.Thread.run(Thread.java:818)
01-01 15:44:31.222 1563-3453/? I/ActivityManager: START u0 {cmp=com.facebook.katana/.ProxyAuth (has extras)} from uid 10164 on display 0
01-01 15:44:31.250 13879-13930/com.google.firebase.udacity.friendlychat D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=1230, _sc=FacebookActivity, _si=2594922199852488391}]
01-01 15:44:31.320 1563-3871/? I/ActivityManager: START u0 {cmp=com.facebook.katana/.gdp.WebViewProxyAuth (has extras)} from uid 10140 on display 0
01-01 15:44:31.340 3456-13966/? V/FA-SVC: Event recorded: Event{appId='com.google.firebase.udacity.friendlychat', name='_e', params=Bundle[{_o=auto, _et=1230, _sc=FacebookActivity, _si=2594922199852488391}]}
01-01 15:44:31.358 1563-3883/? I/ActivityManager: START u0 {cmp=com.facebook.katana/.gdp.ProxyAuthDialog (has extras)} from uid 10140 on display 0
01-01 15:44:31.981 1563-1633/? I/ActivityManager: Displayed com.facebook.katana/.gdp.ProxyAuthDialog: +613ms (total +736ms)
01-01 15:44:32.759 4811-14396/? W/fb4a.BlueServiceQueue: Exception during service
X.2Oo: [code] 100 [message]: (#100) Param third_party_app_id must be a valid application id [extra]:
at X.11M.a(:172075)
at X.11M.a(:171971)
at X.11M.a(:171960)
at X.11M.a(:171979)
at X.2CN.a(:382666)
at X.159.b(:180159)
at X.159.handleResponse(:180124)
at com.facebook.tigon.httpclientadapter.TigonHttpClientAdapterImpl$ClientCallbacks$1.run(:327964)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at com.facebook.common.executors.WrappingExecutorService$1.run(:77498)
at com.facebook.common.executors.DefaultConstrainedListeningExecutorService$Worker.run(:63229)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.facebook.common.executors.NamedThreadFactory$1.run(:77690)
at java.lang.Thread.run(Thread.java:818)
01-01 15:44:46.906 3456-13966/? V/FA-SVC: Uploading data. app, uncompressed size, data: com.google.firebase.udacity.friendlychat, 737,
batch {
bundle {
protocol_version: 1
platform: android
gmp_version: 10084
uploading_gmp_version: 10084
config_version: 1483190241814000
gmp_app_id: 1:1020544687127:android:64e58dacc0483faa
app_id: com.google.firebase.udacity.friendlychat
app_version: 1.0
app_version_major: 1
firebase_instance_id: dsAOV03UKx4
app_store: manual_install
upload_timestamp_millis: 1483265686855
答案 0 :(得分:0)
这是因为我正在使用
<string name="facebook_app_id" translatable="false">XXXXXXXXXXXXXX</string>
我应该使用
<string name="facebook_application_id" translatable="false">XXXXXXXXXXXXX</string>
混乱是因为facebook快速入门指南曾说过使用facebook_app_id,如果是FireBaseUIAuth应该是facebook_application_id。