Facebook身份验证不适用于Android中的Firebase用户界面

时间:2017-08-17 16:37:18

标签: android facebook firebase firebase-authentication firebaseui

之前我曾使用Firebase UI在几个项目中实现身份验证,但由于某些原因,我无法让Facebook身份验证在当前项目中运行。每次单击“使用Facebook登录”按钮时,它都会启动看似验证流程的内容,然后返回到Auth UI屏幕而不执行任何操作。

在Firebase控制台中未创建任何帐户,并且Facebook上未记录任何内容。以下是我采取的步骤并进行了双重检查。

  1. 将Firebase UI最新库添加到项目 - 2.2.0
  2. 添加Facebook Android SDK
  3. 将其他Firebase库更新为11.4.0
  4. 确保Google Play服务为3.0.0
  5. 确保在Firebase控制台中启用了Facebook身份验证
  6. 确保将Facebook App ID和App Secret添加到Firebase控制台
  7. 确保将Firebase oAuth重定向添加到Facebook
  8. 确保将应用正确添加到Facebook并启用
  9. 确保将Facebook App Id添加到res / string资源文件
  10. 使用了与我不同的其他Facebook帐户 开发者帐户
  11. 尝试使用两种不同的物理设备
  12. 没有错误信息,没有Log cat,我还能错过什么?任何帮助将不胜感激这是我的AuthUiActivity

    https://gist.github.com/valokafor/d4d5663bcdcf999be1cd41f331a3b883

    这是我的Gradle依赖项

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
    
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
    
        androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2') {
            // Necessary to avoid version conflicts
            exclude group: 'com.android.support', module: 'appcompat'
            exclude group: 'com.android.support', module: 'support-v4'
            exclude group: 'com.android.support', module: 'support-annotations'
            exclude module: 'recyclerview-v7'
        }
    
    
        compile('org.mnode.ical4j:ical4j:1.0.6') {
            exclude group: 'commons.io'
        }
    
    
        compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
        compile "com.android.support:design:$rootProject.supportLibraryVersion"
        compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
        compile "com.android.support:support-vector-drawable:$rootProject.supportLibraryVersion"
        compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
        compile "com.android.support:support-v4:$rootProject.supportLibraryVersion"
    
        compile('com.mikepenz:materialdrawer:5.9.1@aar') {
            transitive = true
        }
    
    
        compile 'com.android.support:multidex:1.0.1'
        compile 'com.afollestad.material-dialogs:core:0.9.4.5'
        compile 'com.google.android.gms:play-services-auth:11.0.4'
        compile 'com.google.firebase:firebase-crash:11.0.4'
        compile 'com.google.firebase:firebase-core:11.0.4'
        compile 'com.google.firebase:firebase-ads:11.0.4'
        compile 'com.google.firebase:firebase-messaging:11.0.4'
        compile 'com.google.firebase:firebase-auth:11.0.4'
        compile 'com.firebaseui:firebase-ui:2.2.0'
        compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
        compile 'org.greenrobot:eventbus:3.0.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
        compile 'com.github.bumptech.glide:glide:3.7.0'
        compile 'be.billington.calendar.recurrencepicker:library:1.1.1'
        compile 'org.ocpsoft.prettytime:prettytime:3.2.7.Final'
        compile 'com.jakewharton:butterknife:8.5.1'
        compile 'de.hdodenhof:circleimageview:2.1.0'
        compile 'commons-io:commons-io:2.5'
        compile 'org.apache.commons:commons-collections4:4.1'
        compile 'com.afollestad:material-camera:0.4.4'
        compile 'com.google.android:flexbox:0.2.5'
        compile 'com.github.fiskurgit:ChipCloud:3.0.3'
        compile 'com.github.adroitandroid:ChipCloud:2.2.1'
        compile 'com.facebook.android:facebook-android-sdk:4.22.1'
        compile 'com.google.code.gson:gson:2.8.1'
        testCompile 'junit:junit:4.12'
        testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    Firebase Auth控制台 Firebase Console Showing Auth Tab

1 个答案:

答案 0 :(得分:2)

事实证明,这是一件非常简单的事情。

应将Facebook ID添加到字符串中,如下所示:

<string name="facebook_application_id" translatable="false">98765xxxxxxx</string>

而不是Firebase用户界面文档中显示的方式,如此

  <string name="facebook_app_id" translatable="false">987565xxxxxx</string>

完成更新后,感谢此问题FirebaseUI Authentication with Facebook not logging in问题已得到解决