Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
Guervyl opened this issue Feb 23, 2021 · 0 comments
Open

Comments

@Guervyl
Copy link

Guervyl commented Feb 23, 2021

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant