我尝试在Unity中使用firebase phone身份验证系统对用户进行身份验证,但是当我尝试按照link中的firebase文档进行身份验证时,我收到了错误消息。这是我写的代码:
public void sendSms()
{
Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
phoneNumber = "+905555555555";
uint phoneAuthTimeoutMs = 10000;
PhoneAuthProvider provider = PhoneAuthProvider.GetInstance(auth);
provider.VerifyPhoneNumber(phoneNumber, phoneAuthTimeoutMs,null,
verificationCompleted: (credential) => {
},
verificationFailed: (error) => {
},
codeSent: (id, token) => {
MyText.text = "SMS Has been sent " + id;
},
codeAutoRetrievalTimeout: (id) => {
});
MyText.text += "HMM";
}
但是,它说"无法解析符号codeAutoRetrievalTimeout"。当我删除codeAutoRetrievalTimeout参数时,这次我的IDE说"冗余名称标识符" for codeSent,codeAutoRetrievalTimeout和verificationCompleted parts。
答案 0 :(得分:2)
在你的代码中你有 codeAutoRetrievalTime o ut (小写元音)。
只需将其更改为:codeAutoRetrievalTimeOut
,即可找到符号。