Ios 用于生产时Firebase验证电话不工作
因此,我成功地设置了Firebase消息传递和推送通知,效果非常好。然而,当我为phone添加Firebase Auth时,只有沙盒起作用。下面是我的代码:Ios 用于生产时Firebase验证电话不工作,ios,objective-c,firebase,firebase-authentication,Ios,Objective C,Firebase,Firebase Authentication,因此,我成功地设置了Firebase消息传递和推送通知,效果非常好。然而,当我为phone添加Firebase Auth时,只有沙盒起作用。下面是我的代码: -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{ [[FIRAuth auth] setAPNSToken:deviceToken type:F
-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
[[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox];
}
使用FIRAuthAPNSTokenTypeSandbox时,[[FIRPhoneAuthProvider provider]verifyPhoneNumber:phoneNumber…]将起作用。然而,当我使用FIRAuthAPNSTokenTypeProd时,我会得到内部服务器错误。我已经在Firebase控制台上上传了开发和生产证书,当用户通过试飞下载我的应用程序时,推送通知非常有效
我的问题是为什么会出现这种情况,我如何才能解决它?我担心如果我继续使用沙盒,一些未来的用户将无法接收短信,但同时,生产无法工作
另一个问题是,我是否能够本地化和自定义我的短信?我将把这些代码发送给多个国家的用户
如果有人知道答案那就太好了!提前谢谢 回答您的第一个问题:
[[FIRAuth auth]useAppLanguage]代码>参考:
外语版Firebase SMS模板的代码页错误。
- (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];
}
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."