expo-firebase-notifications on iOS (FCM + ExpoKit)

Has anyone got FCM push to work on iOS with expo-firebase-notifications (or any other FCM library for ExpoKit)?

Following instructions on expo-firebase-notifications - npm lets me grab a FCM token, but the actual push notifications are not being delivered when test-sending from Firebase Console. I’ve tried a bunch of things suggested on https://github.com/invertase/react-native-firebase/issues/1203, but with no luck so far.

I’ve followed https://github.com/EvanBacon/expo-native-firebase as well but it’s not clear if iOS push notifs are supposed to be working in that example.

cc @bacon (thanks for all your posts and guides!)

1 Like

Hey @lev make sure the pods/modules are fully up-to-date. Whenever the updates are released I setup the notifications from scratch so I can say for certain that they do work.

  • Make sure you have enabled the notifications capability in XCode
  • You’ve successfully installed expo-firebase-messaging specifically the common iOS setup
  • You have the Google Services plist included in your native project
  • Testing on a real device
  • Targeting the correct app in Firebase console
  • You could try deleting and reinstalling the app (this fixed the problem for me once)
  • Permissions are granted using the expo-permissions module.
  • Refer to this working example code

I’ve also put together a video tutorial because this is a pretty confusing process.

1 Like

Thanks @bacon! I was able to get the sample expo-native-firebase project to work, so I will keep digging at what’s going on with my own project.

I’ve had a few issues with getting expo-native-firebase to run, so wanted to paste notes below in case you want to update the project instructions/docs:

  • XCode project build kept failing until i ran rm -rf Pods && pod install (pod install/pod update was not sufficient)
  • After launching the app I kept getting missing module errors - fixed by adding import "expo-firebase-analytics" and import "expo-firebase-messaging" in App.js (this is a bit confusing since the docs claim you no longer need to explicitly import modules?)
  • The app keeps throwing [Unhandled promise rejection: Error: The application's launch options couldn't be retrieved.] warning on launch. Didn’t seem to affect notifs, so I haven’t investigated further.

One question I had was about using p12 push certs vs a p8 key: Firebase docs recommend a p8 key which is really easy to set up, is there a reason to go with a p12 instead?

Thanks again!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.