我已经创建并配置了firebase项目,并启用了电话号码验证并添加了依赖项
等级:项目级
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.1.0'
}
梯度模块级
dependencies {
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.0'
compile 'com.google.android.gms:play-services-auth:9.2.0'
}
apply plugin: 'com.google.gms.google-services'
我无法解析PhoneAuthProvider
private void startPhoneNumberVerification(String phoneNumber) {
// [START start_phone_auth]
PhoneAuthProvider.getInstance().verifyPhoneNumber(
phoneNumber, // Phone number to verify
60, // Timeout duration
TimeUnit.SECONDS, // Unit of timeout
this, // Activity (for callback binding)
mCallbacks); // OnVerificationStateChangedCallbacks}
遵循this文档中的所有步骤
最佳答案
在version 11.0中添加了电话身份验证。您需要更改build.gradle以至少需要该版本:
compile 'com.google.firebase:firebase-core:11.4.0'
compile 'com.google.firebase:firebase-messaging:11.4.0'
compile 'com.google.firebase:firebase-auth:11.4.0'
关于android - PhoneAuthProvider无法解决?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46341779/