在quickstart-android个示例项目中,我正在尝试针对以下版本的无密码方法的Firebase Auth Quickstart示例:
parser.add_argument('-a', '--add', help ="Add device", metavar='', required=True)
我已经按照项目README中的说明进行了设置,但是出现以下错误(Logcat):
// Firebase Authentication
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.0'
// Google Sign In SDK (only required for Google Sign In)
implementation 'com.google.android.gms:play-services-auth:15.0.1'
// Firebase UI
// Used in FirebaseUIActivity.
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
06-25 10:51:31.603 3657-3657/com.google.firebase.quickstart.auth W/PasswordlessSignIn: Could not send link
com.google.firebase.FirebaseException: An internal error has occurred. [ UNAUTHORIZED_DOMAIN:Domain not whitelisted by project ]
at com.google.firebase.auth.api.internal.zzce.zzb(Unknown Source:55)
表包含Firebase->Authentication->Authorized domain
作为授权域。
我想念什么?
答案 0 :(得分:0)
首先请确保已将域'yourdomain.com'添加到Firebase的“授权”域中的“身份验证”菜单中。如果您已经在其中声明了域,则假设您正在使用:
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
}
尝试更新为最新版本,例如:
// Firebase Authentication
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
// Google Sign In SDK (only required for Google Sign In)
implementation 'com.google.android.gms:play-services-auth:15.0.1'
// Firebase UI
// Used in FirebaseUIActivity.
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
还要确保您正在使用:
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:customtabs:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
如果您使用的是其他Firebase库,请检查所有内容是否基于on this link:
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-analytics:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-functions:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-invites:16.0.0'
implementation 'com.google.firebase:firebase-perf:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-config:16.0.0'
答案 1 :(得分:0)
对我来说,它可以使用以下方法工作:
ActionCodeSettings settings = ActionCodeSettings
.newBuilder()
.setUrl("https://auth.example.com/emailSignInLink")
也在控制台中设置授权域:auth.example.com
答案 2 :(得分:0)