This question is locked. New answers and comments are not allowed.
I have a Phonegap App in which I have implemented push notifications with JavaScript SDK/REST API. When the user taps the received notification, I'm showing a local notification which contains a link(button) to a specific page (inside my app) based on the payload of the push notification. For this I'm using the on push received callback of course.
On Android and iOS everything is working fine. It also works if the WP application is open when the push notification is received. Where I'm having problems is when the app is not running and the toast is tapped, because the notification callback is never fired. This is not unexpected, because I know that's normal behavior of WP.
What I'm trying to do instead is to set the launch page(LandingUri) to that page. So when the user taps the toast when the app is not running, the app should open directly to that page. I'm sending the message as specified in the documentation:
When I inspect the received notification in the callback it looks like this:
I have tried to set the LandingUri in multiple different ways, for example:
and
I'm using Backbone Marionette router, so that's why the url is set like this: #api/. the-page is the dynamic part that's defining where to land. The problem is, it never lands on the page I defined. Most of the time it lands on the index page and sometimes the app crashes before it even starts. No error is received, it just shuts down.
I'm a total noob when it comes to Windows Phone, so my question is: How should I set the LandingUri in the object? Or am I doing something else wrong?
Alternatively, is there any other way to achieve the behavior I want, which is: navigating to a specific page inside my application based on an uri received in a push notification (after the toast is tapped when the application is not running)?
For additional information, I'm using Phonegap Build. I'm also more than happy to provide more info if needed. I would be very grateful if anyone could help me.
On Android and iOS everything is working fine. It also works if the WP application is open when the push notification is received. Where I'm having problems is when the app is not running and the toast is tapped, because the notification callback is never fired. This is not unexpected, because I know that's normal behavior of WP.
What I'm trying to do instead is to set the launch page(LandingUri) to that page. So when the user taps the toast when the app is not running, the app should open directly to that page. I'm sending the message as specified in the documentation:
"WindowsPhone": {
"Toast": {
"Title": title,
"Message": message,
"LandingUri": uri
}
}
When I inspect the received notification in the callback it looks like this:
{
"jsonContent": {
"wp:Text1": title,
"wp:Text2": message,
"wp:Param": uri
},
"type": "toast"
}
I have tried to set the LandingUri in multiple different ways, for example:
//www/index.html#api/the-page
x-wmapp0:www/index.html#api/the-page
I'm using Backbone Marionette router, so that's why the url is set like this: #api/. the-page is the dynamic part that's defining where to land. The problem is, it never lands on the page I defined. Most of the time it lands on the index page and sometimes the app crashes before it even starts. No error is received, it just shuts down.
I'm a total noob when it comes to Windows Phone, so my question is: How should I set the LandingUri in the object? Or am I doing something else wrong?
Alternatively, is there any other way to achieve the behavior I want, which is: navigating to a specific page inside my application based on an uri received in a push notification (after the toast is tapped when the application is not running)?
For additional information, I'm using Phonegap Build. I'm also more than happy to provide more info if needed. I would be very grateful if anyone could help me.