首页 文章

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

提问于
浏览
1

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

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

  • 将Firebase UI最新库添加到项目中 - 2.2.0

  • 添加Facebook Android SDK

  • 将其他Firebase库更新为11.4.0

  • 确保Google Play服务为3.0.0

  • 确保在Firebase控制台中启用了Facebook身份验证

  • 确保将Facebook App ID和App Secret添加到Firebase控制台

  • 确保将Firebase oAuth重定向添加到Facebook

  • 确保将应用程序正确添加到Facebook并启用

  • 确保将Facebook App Id添加到res / string资源文件中

  • 使用了与我的开发者帐户不同的其他Facebook帐户

  • 试用了两种不同的物理设备

没有错误消息,没有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 回答

  • 2

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

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

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

    而不是像这样出现在Firebase UI doc中的方式

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

    一旦我做了更新,感谢这个问题FirebaseUI Authentication with Facebook not logging in问题得到了解决

相关问题