Support push notification in simulator/emulator
K
Kasra Ghasemi
According to the react native firebase doc, the push notification does not work in simulator. Even Out-of-app notifications (when app is in background and you see the notification in the status bar) does not work when you run the app on your real ios/Android device connected to your PC by cable. (In-app notifications work though using messaging().onMessage)
Current behavior: My Firebase push notification works perfectly on both Android and ios in standalone apk/ipa. However, I cannot test it during development on simulator.
Desired behavior: I want to receive push notification (Out-of-app notification) when the app is running on simulator in background, so that I can use messaging().onNotificationOpenedApp method as usual.
Why I need this? Of course, each time I make a change regarding push notification, I can create a standalone app, install it on phone to see how it works. This approach has many issues:
It's super time-consuming and does not make sense at all
If the code does not work as expected, there is no way to check what goes wrong
There is no console.log, in general, no way to debug the code
Elliot Hesp
This is a limitation of Apple, their simulators do not support Push Notifications. They do support dropping a JSON file onto the simulator (Xcode 11.4), however this doesn't trigger FCM/APNs delegate handlers so it doesn't work with RNFB.
K
Kasra Ghasemi
Elliot Hesp: Thank you for your response. Is there any trick for this? Because it's infeasible to create a new build for testing when a single line of code has been changed. We need a way of debugging.