如何使用unity从Firebase发送Sms



祝你今天愉快。。。我正在学习Firebase。在我的应用程序中,我如何发送短信(密码验证码(。来自Unity。

有人能帮我吗?

从Unity的Firebase文档发送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.
});

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

最新更新