Jay Bean
Jay Bean

Reputation: 23

Local notification not displaying in React Native Android App

My local notifications are not displaying in the Android emulator. I'm using the react-native-firebase from https://rnfirebase.io/. I'm able to send local notifications through the firebase console and they display properly. But when I use the code

firebase.messaging().createLocalNotification({
            body: "body",
            icon: "ic_launcher",
            show_in_foreground: "true",
            title: "title",
            local_notification: "true",
            priority: "high",
            click_action:"ACTION"
        });

...nothing displays

If I use the onMessage() function I can see that I'm receiving the notification, but I'm not seeing the notification in the Android notification tray. Does anyone have experience with notifications and the react-native-firebase invertase library?

Upvotes: 0

Views: 3488

Answers (1)

Jay Bean
Jay Bean

Reputation: 23

The icon property cannot be empty, and the value must exist in your project where you store your resources. The "true" should not have double quotes. Notification is displaying properly now.

Upvotes: 1

Related Questions