I am developing an Android app which uses Firebase to send notifications. Everything works as expected when using my physical device (Google Nexus 5, and also tested on others), but I cannot receive notification when using the emulator.
Platform: Windows Android Studio: 2.3.1 with Google Play Services 39 API: 24 Emulator: Nexus 6 API 24, Android 7.0
Any idea?
You can also test push notifications in the Android emulator. Like the iOS Simulator, it can register for notifications and display them.
Stay organized with collections Save and categorize content based on your preferences. FCM clients require devices running Android 4.4 or higher that also have the Google Play Store app installed, or an emulator running Android 4.4 with Google APIs.
Have you tried using different emulator configurations, targeting the emulator from the Firebase console using the single device option with the generated Firebase instance token, verifying Firebase notification status for the messages are marked complete? Are you sending a background notification when the app is in the foreground? Are you sure Google Play Services are available on the emulator?
The single device option will probably help you the most when you debug. Repeat these steps as you make small incremental changes to your code:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With