簡體   English   中英

用於生產時,Firebase Auth Phone無法正常工作

[英]Firebase Auth Phone not working when using for production

因此,我已經成功設置了Firebase Messaging,並且推送通知效果很好。 但是,當我為電話添加Firebase Auth時,僅沙箱有效。 下面是我的代碼:

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
    [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox];
}

使用FIRAuthAPNSTokenTypeSandbox時,[[FIRPhoneAuthProvider提供程序] verifyPhoneNumber:phoneNumber ...]將起作用。 但是,當我使用FIRAuthAPNSTokenTypeProd時,會出現內部服務器錯誤。 我已在Firebase控制台上上傳了開發證書和生產證書,並且當用戶通過Test Flight下載我的應用程序時,推送通知效果很好。

我的問題是為什么會這樣,我將如何解決? 恐怕如果我繼續使用沙箱,將來的某些用戶將無法接收SMS消息,但是同時生產無法正常進行。

我還有一個問題,我是否可以本地化和自定義SMS消息? 我將這些代碼發送給多個國家/地區的用戶。

如果有人知道答案,那就太好了! 提前致謝!

回答第一個問題:

  1. 當我為手機添加Firebase Auth時,僅沙箱有效。

請注意,關於共享版本時您使用的證書類型,

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

    // If you are using the development certificate you have to use this,
        [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox];

    // If you are using distribution certificate you should use this
        [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeProd];

    // If you want Firebase to automatically detect the type use this.
        [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeUnknown];

    }
  1. a)本地化:可以。

[[FIRAuth auth] useAppLanguage]; 參考: Firebase電話號碼驗證文檔

  b) Customize my SMS messages : No you can't. 
  As this may abuse the user experience. Got clarification from Firebase as "Those templates can't be edited, sorry. There is a good deal of concern that this service could be abused and used for spam and other bad practices."

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM