如何使用unity从Firebase发送短信

如何使用unity从Firebase发送短信,firebase,unity3d,firebase-authentication,Firebase,Unity3d,Firebase Authentication,祝你今天愉快…我正在学习Firebase。在我的应用程序中,我如何从Unity发送sms(密码验证码) 有人能帮我吗。来自: 调用PhoneAuthProvider.VerifyPhoneNumber,将用户的电话号码传递给它 PhoneAuthProvider provider = PhoneAuthProvider.GetInstance(firebaseAuth); provider.VerifyPhoneNumber(phoneNumber, phoneAuthTimeoutMs, nu

祝你今天愉快…我正在学习Firebase。在我的应用程序中,我如何从Unity发送sms(密码验证码)

有人能帮我吗。

来自:

调用PhoneAuthProvider.VerifyPhoneNumber,将用户的电话号码传递给它

PhoneAuthProvider provider = PhoneAuthProvider.GetInstance(firebaseAuth);
provider.VerifyPhoneNumber(phoneNumber, phoneAuthTimeoutMs, null,
  verificationCompleted: (credential) => {
    // Auto-sms-retrieval or instant validation has succeeded (Android only).
    // There is no need to input the verification code.
    // `credential` can be used instead of calling GetCredential().
  },
  verificationFailed: (error) => {
    // The verification code was not sent.
    // `error` contains a human readable explanation of the problem.
  },
  codeSent: (id, token) => {
    // Verification code was successfully sent via SMS.
    // `id` contains the verification id that will need to passed in with
    // the code from the user when calling GetCredential().
    // `token` can be used if the user requests the code be sent again, to
    // tie the two requests together.
  },
  codeAutoRetrievalTimeout: (id) => {
    // Called when the auto-sms-retrieval has timed out, based on the given
    // timeout parameter.
    // `id` contains the verification id of the request that timed out.
  });

有关完整信息,请参阅链接文档。

您的应用程序是否在移动设备上,如果是,则适用于Android或IOS或两者?感谢Frant提供的代码。我用过你的密码。但是没有收到短信。我已启用电话身份验证。我要做什么来接收短信。对于其他用户。如果你的帖子上面有代码。您将收到错误消息。因此,将此codeAutoRetrievalTimeout更改为codeAutoRetrievalTimeout以解决此错误。在搜索论坛时,我发现已启用SHA证书指纹。是否必须启用才能发送短信。我仅在进行测试。我正在使用unity 2018。并粘贴上述代码并添加谷歌服务。但是没有收到短信。比我要做的还要多?