Closed RayVR closed 3 years ago
Hey there, thanks for the question - I think this does trip people up, including myself. It's an Android requirement that if you need the notification as a heads-up notification, the channel needs to have the importance of high
(ref: https://notifee.app/react-native/reference/androidimportance#high):
import notifee, { AndroidImportance } from '@notifee/react-native';
const channelId = await notifee.createChannel({
id: 'important',
name: 'Important Notifications',
importance: AndroidImportance.HIGH,
});
await notifee.displayNotification({
title: 'Your account requires attention',
body: 'You are overdue payment on one or more of your accounts!',
android: {
channelId,
importance: AndroidImportance.HIGH,
},
});
It's easier on iOS as this is the default behavior.
Hope that helps
This is a huge help.
Thank you!
On Aug 5, 2021, at 20:18, Helena Ford @.***> wrote:
Hey there, thanks for the question - I think this does trip people up, including myself. It's an Android requirement that if you need the notification as a heads-up notification, the channel needs to have the importance of high (https://notifee.app/react-native/reference/androidimportance#high):
import notifee, { AndroidImportance } from @.***/react-native';
const channelId = await notifee.createChannel({ id: 'important', name: 'Important Notifications', importance: AndroidImportance.HIGH, });
await notifee.displayNotification({ title: 'Your account requires attention', body: 'You are overdue payment on one or more of your accounts!', android: { channelId, importance: AndroidImportance.HIGH, }, }); It's easier on iOS as this is the default behavior.
Hope that helps
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I'm somewhat confused as to why the behavior of notifee on Android differs so much from iOS and react-native-push-notification (I am not experienced with the Android platform)
Notifications on Android are essentially hidden from the user until they pull down the system tray. Is there a recommended way to show a notification slide in from top similar to iOS or react-native-push-notification?