Skip to content

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

New issue

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

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

Already on GitHub? Sign in to your account

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.

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

No branches or pull requests

1 participant