nativescript-local-notifications
nativescript-local-notifications copied to clipboard
How to use routing when notification tapped when app is on background?
I have this code in my app component:
// Inside ngOnInit
LocalNotifications.addOnMessageReceivedCallback(data => this._ngZone.run(() => {
this.handleNotifikasyon()
}, this));
// Insite the class
handleNotifikasyon(): void {
this.router.navigate(["/the-path"]])
console.log('handling')
}
When the app is on the foreground and I tap the notification, the router navigates to the path correctly.
But, If I close the app by pressing the back button, and then tap the notification, the app opens, it prints the text handling but it does not navigate to the path.