-
Page Navigation on click of push notification
about 9 years ago
-
about 9 years ago
You can redirect to another page in notification success callback. Like in iOS:
function onNotificationAPN (event) { if ( event.alert ) { document.location.href = 'path to your file/notification.html'; } }
and in Android:
var onNotificationGCM = function(e) { // Check which event: switch(e.event) { case 'registered' : { deviceToken = e.regid; break; } case 'message': { // this is the actual push notification. its format depends on the data model from the push server var message = e.message; document.location.href = 'path to your file/notification.html'; break; } } };
1 Answer(s)