小编Why*_*s33的帖子

无法从 Firebase 控制台接收 IOS 通知

我一直致力于向用户推送通知。在 Xcode 中,我收到从 Firebase 发送的所有通知。但是,当推送到应用程序商店时,我不再收到它们。

它在 firebase 上表示发送了 X 数量,但接收/打开的数量为零。

这是我的应用程序委托:

    Did Finish Launching:

    //Firebase Integration
    FirebaseApp.configure()
    FirebaseConfiguration.shared.setLoggerLevel(.min)

    //Enabling push notifications
    registerForPushNotifications()

    //Handle Notification
           
    if #available(iOS 10.0, *) {
      // For iOS 10 display notification (sent via APNS)
      UNUserNotificationCenter.current().delegate = self

      let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
      UNUserNotificationCenter.current().requestAuthorization(
        options: authOptions,
        completionHandler: { _, _ in }
      )
    } else {
      let settings: UIUserNotificationSettings =
        UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
        // For iOS 10 display notification (sent via APNS) …
Run Code Online (Sandbox Code Playgroud)

push-notification apple-push-notifications ios firebase-cloud-messaging

7
推荐指数
1
解决办法
1万
查看次数