This repository was archived by the owner on Feb 7, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 44
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
Navigate on receiving pushnotifcation #103
Copy link
Copy link
Closed
Labels
Description
I am able to receive push notification on all time after register.
App is redirecting to particular route based on push notification, when i minimize the app.
But when i kill the app. On tapping push notification message. It is not routing to the routes
I registered for push notification using ..service.ts(angular) on app.component.ts(onNgInit).
ngOnInit() {
this.pushService.checkAndRegisterPush();
}
on service i am registering to azure.
var pushPlugin = require("nativescript-push-notifications");
var that = new WeakRef(this);
var settings = {
senderID: "xxxxxxxxxxxxx",
notificationCallbackAndroid: function (message, pushNotificationObject) {
console.log(JSON.stringify(pushNotificationObject));
var pushMessage = JSON.parse(pushNotificationObject);
if (pushMessage.module && pushMessage.moduleid && pushMessage.foreground === false)
that.get().LoadModule(pushMessage.moduleid, pushMessage.module);
}, badge: true, sound: true, alert: true,
notificationCallbackIOS: function (message) {
console.log(JSON.stringify(message));
if (message.module && message.moduleid && message.foreground === "0")
that.get().LoadModule(message.moduleid, message.module);
}
};
console.log("RegisterPushNotification");
pushPlugin.register(settings, (data) => {
if (pushPlugin.onMessageReceived) {
pushPlugin.onMessageReceived(settings.notificationCallbackAndroid);
}
console.log(data);
setString("MobilePushID", data);
this.registerToAzure(data);
//setString("tag", "true,true,true");
}, (e) => { console.log(e); });
In App.component.html contains only Routeroutlet
Default route has some http polling service.
Do i missed any thing?
In some rare instance it is redirecting. Is that related to thread/Delay on registration?
It worked as expected in android.
Reactions are currently unavailable