Search code examples
iospush-notificationfirebase-cloud-messagingcapacitorcapacitor-plugin

Issue with receiving push notifications on iOS using Capacitor and Firebase


I am facing a problem with receiving push notifications on iOS using Capacitor and Firebase Cloud Messaging. Here are the details:

  • I'm using @capacitor/push-notifications, and followed the setup steps provided in the plugin documentation for iOS.
  • Android devices receive notifications successfully, but iOS devices do not.
  • PushNotifications.register() runs successfully and the FCM token is obtained from iOS device.
  • Notification permission is asked at first startup. I also checked the app settings. Notifications are enabled.
  • I have downloaded GoogleService-Info.plist from FCM and pasted it into the root of my IOS project.
  • I have uploaded the APNs Certificates for both Development and Production modes in FCM dashboard.
  • Im using "@capacitor/core": "^5.0.0", "@capacitor/push-notifications": "^5.0.4" and "@capacitor/ios": "^5.0.5".
  • I have tried sending a test notification directly to that device from FCM dashboard (using device FCM token), but no notification is received.
  • I have tried this scenario on a real device and an emulator. still no luck.

Despite these steps, notifications are not received on iOS devices/emulators. I would appreciate any guidance. Thank you in advance.


Solution

  • I used @capacitor-firebase/messaging plugin instead of @capacitor/push-notifications and that worked for me.

    ( This guide helped me ,Thanks to RGe )