Swift中的FireBase PhoneNumber验证错误

时间:2017-07-07 06:36:11

标签: ios iphone firebase swift3 firebase-authentication

我正在我的应用程序中实现Firebase phoneNumber验证。然后错误在我的应用程序中生成:

  

如果禁用了app delegate swizzling,则需要将UIApplicationDelegate收到的远程通知转发给FIRAuth的canHandleNotificaton:方法。

1 个答案:

答案 0 :(得分:2)

您可能会错过在AppDelegate中添加此方法

func application(_ application: UIApplication,
                 didReceiveRemoteNotification notification: [AnyHashable : Any],
                 fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    if Auth.auth().canHandleNotification(notification) {
        completionHandler(.noData)
        return
    }
    // This notification is not auth related, developer should handle it.
    handleNotification(notification)
}