I've integrated OneSignal sdk to my react-native project, everything seems to be working fine, except when we add a Title to the push message the android receives a double push notification. When we send the push notification without the title, the android receives one(as intended). Any advise is greatly appreciated.
EDIT:
My code:
// App.js
OneSignal.setAppId("my-app-id");
//Method for handling notifications received while app in foreground
OneSignal.setNotificationWillShowInForegroundHandler(notificationReceivedEvent =>
{
let notification = notificationReceivedEvent.getNotification();
const data = notification.additionalData
notificationReceivedEvent.complete(notification);
});
//Method for handling notifications opened
OneSignal.setNotificationOpenedHandler(notification => {
console.log("OneSignal: notification opened:", notification);
});
I send the push notification through the dashboard - app.onesignal.com by creating a new push notification.