skip to Main Content

I have a cross platform flutter app. I am using FCM to send notifications and they are not arriving on the iOS app in any state (foreground, background, terminated). I am testing on a physical device.

The notifications work on Android, so I know the topic subscription and send code is correct.

I have followed these steps for configuration defined here…

https://firebase.flutter.dev/docs/messaging/apple-integration/

To verify I have:

  • added and initialized firebase using google-services-info.plist.

  • created and added my APNS key

  • created the app identifier in the Apple Developer center and confirmed it matches my apps bundle id (and added push notification
    capability for the identifier.

  • added push notification capability to the app in xcode

  • added background fetch and background remote notification capabilities to the app in xcode.

It seems like I have addressed every step to configure FCM on iOS. But none of my notifications arrive.

When the app is minimized, no system tray notification is triggered, and when in the foreground the FirebaseMessaging.onMessage is never triggered, like is is when on Android.

An important note is that this is the second iOS app added to this project, and the first iOS app works correctly. Though there is no indication that there are any special steps for a second app.

3

Answers


  1. Your question is very blur to have a specific answer but you can separate your concerns to find the issue and then try to resolve that:

    1. Make sure about the APNs configuration

    First, try to send a notification to your iOS app, directly using the APNS key. If you get the notification, it means you have configured the APNS correctly

    2. Make sure about the firebase setup

    Check with both the Android and iOS app and see if there are connected to the firebase console. You can use the real-time event to confirm that.

    3. Make sure you have implemented the correct methods.

    Firebase and apple have different methods for push notifications. Make sure you are implementing the correct one. Also, it may vary based on the configuration file of firebase. search for iOS firebase swizzling for more information

    4. Make sure you got the right permissions from the user

    You should get the notification permission from the user before trying to show any notification. Make sure you’ve done that

    Note that you may have already tried some of these but I’ve mentioned them for the sake of completeness. Hope it helps you and others.

    Login or Signup to reply.
  2. We saw a similar problem (for a native iOS app) where FCM would deliver to one app in the project but not the other. The mistake we made was not repeating the configuration in Firebase for the other apple bundle id since each app in our project has a different bundle id. Given it works for one of your iOS apps but not the other on the same project, it sounds like you’ve got the same issue.

    Also, a good diagnostic step is to use the Firebase Console to manually send off a Push Notification to a particular app. It means you can then discount errors further upstream in your backend that may not have caused FCM to be invoked.

    Login or Signup to reply.
  3. Have you tried to send testing notifications via firebase console?
    You can log your device token in your app.
    Background notification must work if you have done correct with firebase and APN settings despite without implementing some methods of AppDelegate file for remote notification on the next step.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search