For the life of me, I can't get #getLaunchNotification to work as advertised. It never gets called. Maybe I'm calling it at the wrong time in the lifecycle? Can someone help me with a full example of how to use it?

Here's a super basic example that's not working for me:

document.addEventListener('deviceready', function(){
    var push = cordova.require('com.pushwoosh.plugins.pushwoosh.PushNotification');
    push.getLaunchNotification(function(notification){
        alert('Launched from notification!');
        trackJs.track('Launched from notification!');
    });
}, false);
asked 25 Sep '15, 14:37
bfischer1121's gravatar image

bfischer1121
11

It's pretty simple (you have to launch the app from push notification of course):

var pushNotification = cordova.require('com.pushwoosh.plugins.pushwoosh.PushNotification');
pushNotification.getLaunchNotification(
    function(notification) {
        if (notification != null) {
            alert(JSON.stringify(notification));
        } else {
            alert("No launch notification");
        }
    }
);
permanent link
answered 25 Sep '15, 14:57
shader's gravatar image

shader
3.9k7

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×353
×326
×47

question asked: 25 Sep '15, 14:37

question was seen: 1,598 times

last updated: 25 Sep '15, 14:57