I am setting up push notifications with my react native app to android users using Firebase Cloud Messaging. So far I have followed mostly this tutorial. I managed to make push notifications to show on lock screen, and deal with them when the app is on foreground. When app is on background, though, I can't manage to show notification as a pop up. It appear on the notification tray, but it does not show a pop up, like gmail's or whatsapp's notifications do.
I believe my problem is that I am not sending the correct params with the message. I am using firebase console, so it's not very flexible. How can I config (programmatically) an notification to show as pop up upon receival?
EDIT:
Setting Up notification Channel works for newer android devices - tested on Android 8.1 (API level 27).
On older devices - testing on Android 6.0 (API level 23) -, heads up notifications still doesn't appear. I am sending the following message using aws sns console:
{
priority: 'high',
content_available: true,
notification: {
title: 'hello',
body: 'Just test',
android_channel_id: 'test-channel',
sound: 'default'
},
data: { title: 'title', body: 'body', sound: 'default' }
}
I also sent messages using Firebase console setting Priority High and Sound Enabled, with and without Android Channel Id. None of that worked. The notification arrives silently on tray bar. This discussion shows the same problems, but the solution one person pointed did not work for me. I didn't go through editing the react-native library code a lot. I tried section Problems with older Android version (Foreground), it made heads up appear on foreground, but not on background, which is the intended behaviour here.
Furthermore, is seems that this is an unresolved issue to quite a few people using this react native package (github issue, github issue).
So, I think I should reformulate my question. For Android 7.1 or lower(testing on 6.0):
Is setting priority='high' and notification.sound='default' supposed to be enough to show heads up notification? (From my research it should be)
Do I need to make any further configuration on my application code to go from notification arriving silently on tray bar to it appering as a heads up?