我开发了一个应用程序,可以使用 Firebase 电话号码身份验证通过电话号码验证用户。
Android 版本在 Google Play 发布后工作正常,但 iOS 版本尽管在开发测试期间工作正常,但无法接收短信。
为什么会出现这种情况?
当上传到 Google Play 时,我被要求提供我的应用程序的 SHA 密钥详细信息,但我没有被要求,甚至不知道该过程的 App Store 等效项是什么。
app-store ios swift firebase-authentication firebase-cloud-messaging
我找不到任何明确的答案,我开始挣扎。到目前为止,我最接近的是present所需的视图控制器,但显然它以模态显示,而不是使用选项卡栏或导航栏。
我在我AppDelegate的didReceiveRemoteNotification函数中尝试处理 Firebase 推送通知。基本上,我希望能够根据我在 Firebase 控制台上分配的键值对自动切换到我的应用程序中的特定视图控制器。
到目前为止,我的 App Delegate 看起来像这样:
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
let info = userInfo as NSDictionary
let name: String = info.value(forKey: "view-controller") as! String
switch name {
case "controller1":
print("controller1")
let storyBoard = UIStoryboard.getMainStoryboard().instantiateInitialViewController()
UIApplication.shared.delegate!.window!!.rootViewController = storyBoard
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) {
print("Time now reached")
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller1VC = storyboard.instantiateViewController(withIdentifier: "controller1VC") …Run Code Online (Sandbox Code Playgroud) uiviewcontroller apple-push-notifications ios swift firebase-cloud-messaging