Messages
In-app messaging and push notifications with the Grovs React Native SDK
If console messages have automatic display enabled in your dashboard, they will appear in your app without any additional integration.
Push notifications
Pass the FCM token to the SDK to receive push notifications for dashboard messages:
import Grovs from 'react-native-grovs-wrapper';
import messaging from '@react-native-firebase/messaging';
const token = await messaging().getToken();
if (token) {
Grovs.setPushToken(token);
}Displaying messages
Show the full list of messages:
Grovs.displayMessages();Unread count
Get the number of unread messages — useful for showing a badge:
const count = await Grovs.numberOfUnreadMessages();
console.log(`Unread: ${count}`);