I finished my first advanced
@expo Module, and I had to handle Android background notifications in it. However, we can only register a single FirebaseMessagingService subclass.
So here is my solution to keep using expo-notifications (because they are a god-sent):
- Add expo-notifications as a dependency in my project (package.json AND build.gradle)
- Remove ExpoFirebaseMessagingService from the merged manifest using tools:node="remove" in my manifest
- Subclass ExpoFirebaseMessagingService, delegating it all notifications I do not want to handle myself, and picking and handling those I care about
- Declare my subclass in the manifest
If there is a better way to do it, or one that also works on iOS (keeping expo-notifications and still register my own delegate), I'd love for you to share it!