Can somebody help me navigate after push notification is received??
I get "cannot read property 'navigate' of undefined"
This code is inside main.ts and there is no class or constructor to initialize variables:
`
import { RouterExtensions } from "nativescript-angular/router";
let router: RouterExtensions;
setTimeout(() => {
let firebase = require("nativescript-plugin-firebase");
firebase.init({
onPushTokenReceivedCallback: function(token) {
deviceToken = token;
console.log("Firebase push token: " + token);
},
onMessageReceivedCallback: (message) => {
// let router: RouterExtensions; //tried initializing it here but didnt work also
let link = JSON.stringify(message.website);
router.navigate(["webViewPage"],{
clearHistory:true,
transition: {
name: "slideTop",
duration: 800,
curve: "spring"
},
queryParams:{"url": link},
animated: true
});
}
Can somebody help me navigate after push notification is received?? I get "cannot read property 'navigate' of undefined"
This code is inside main.ts and there is no class or constructor to initialize variables: ` import { RouterExtensions } from "nativescript-angular/router";
let router: RouterExtensions; setTimeout(() => {
.......... `