nativescript-local-notifications icon indicating copy to clipboard operation
nativescript-local-notifications copied to clipboard

How to use routing when notification tapped when app is on background?

Open Guervyl opened this issue 4 years ago • 0 comments

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.

Guervyl avatar Feb 23 '21 03:02 Guervyl