![](/img/trans.png)
[英]Is there any way to send firebase OTP SMS authentication through web
[英]Firebase Phone Authentication operates with Limits to 5 OTP SMS only- Mobile App in Flutter
需要 Firebase 社區的幫助!
我們已經使用 Flutter 中的電話提供商實現了 Firebase 身份驗證。
在pubsec.yaml中配置的插件下面
firebase_core:^1.3.0 firebase_auth:^1.4.1
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: phoneNumberText,
verificationCompleted: (PhoneAuthCredential authCredential) =>
_verificationComplete(
context, authCredential, phoneNum,
updateWrongPhoneUI: updateWrongPhoneUIWidget,
duplicateUser: duplicateUserhandler),
verificationFailed: (FirebaseAuthException exception) =>
_verificationFailed(exception,
updateWrongPhoneUI: updateWrongPhoneUI),
//經過 5 次嘗試 - 我們得到的響應是too-many-requests
codeSent: (String verificationIdLocal, int resendTokenLocal) => _codeSent(
verificationIdLocal, resendTokenLocal,
updateWrongPhoneUI: updateWrongPhoneUI),
** //在這個回調中,我們重定向到輸入屏幕獲取 OTP**
codeAutoRetrievalTimeout: (String verificationId) {
print('FirebaseAuth ' 'Code auto retrieval Timedout');
},
);
問題:在同一電話號碼上嘗試電話身份驗證 5 次后,SMS (OTP) 停止流動。
我們正在運行SPARK定價計划。
如果在一段時間內多次發送到同一個電話號碼,則消息會受到限制。
因此,您可以執行以下任一操作:
這是文檔中的引用:
為了防止濫用,Firebase 對在一段時間內可以發送到單個電話號碼的 SMS 消息的數量進行了限制。 如果超出此限制,電話號碼驗證請求可能會受到限制。 如果您在開發過程中遇到此問題,請使用其他電話號碼進行測試,或稍后再嘗試請求。
根據他們的支持團隊,限制是每 4 小時 5 條短信。
現在您最多可以添加 10 個虛構(測試)電話號碼。
意味着您可以使用這些電話號碼進行測試
現在 go 在這里並啟用身份平台並單擊提供商然后單擊手機上的編輯按鈕 Auth
然后會出現一個屏幕,在其中添加您的測試電話號碼(例如 +919876543210)和您自己的 OTP(例如 123456)
注意:在添加您的手機號碼進行測試之前,請確保在現有的身份驗證選項卡中刪除您的手機號碼,否則它將無法正常工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.