I’m sending a push notification with Firebase and it works. When I send a payload with the push notification how is possible to read the data from the payload in the component.
When I alert the msg object from the observable it alerts [object, Object]
Here is the code that subscribes to the push notification
this.push.rx.notification()
.subscribe((msg) => {
alert(msg.title + ': ' + msg.text);
if (msg.app.asleep || msg.app.closed) {
// The app is being opened from a notification
alert("OPEN APP");
alert(msg);
this.rootPage = RetailPage;
} else {
// The app was already open when the notification was received
alert("APP WAS OPEN");
}
});
}
Your system information:
ordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.46
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.7.0
Xcode version: Not installed
Any help appreciated
Best regards