[英]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消息? 我将这些代码发送给多个国家/地区的用户。
如果有人知道答案,那就太好了! 提前致谢!
回答第一个问题:
- 当我为手机添加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];
}
- 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.