Search code examples
iosflutterdartfirebase-cloud-messagingios17

Firebase notification not receiving in background for iOS 17 in flutter


Flutter, Having some issues in Firebase notification receiving in iOS 17 versions. While the app is opened Notification is received properly. But when I put the app in the background or terminate it means the Notification is not received. But In iOS 15.8.1 receiving the notifications properly. Is there any issue with iOS 17? Does anyone face this issue?

I've tried adding these functions in Appdelegate.swift, but still faced the issue...

 func function(application: UIApplication,
                 didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Messaging.messaging().apnsToken = deviceToken
}

Following this thread, I've come to know that there was an issue with iOS 17 beta versions. Is this the actual problem or something else? Kindly guide me through... Thanks in advance


Solution

  • Used the Push Message method for conversion of date time based on the user's timezone. I have fixed this issue by changing the Push Message to the Push Notification method. While using the Push message method it's hard to show the notification while the app is in a Background or Killed state. So Using the Push Notification method is the best way for notification. After that, I faced the issue of notification issue in iOS. For that, in info.plist file change the FirebaseAppDelegateProxyEnabled = NO into FirebaseAppDelegateProxyEnabled = YES.