how to display only alert after push notification

You must Login before you can answer or comment on any questions.

Hi,

on iPhone

i use :

callback:function(e)
            {
                // called when a push notification is received.
                alert(e.data.alert);
            }
you see e.data.alert

On android :

here is my code :

CloudPush.addEventListener('callback', function (evt) {
            //What   
        });
    })();to do when get notified
            alert(evt.payload.alert);
        });
but alert is empty...so i think i should add something after evt.payload but i dont know why ?

thanks for help.

1 Answer

why doesnt your code look like this?

CloudPush.addEventListener('callback', function (evt) {
    // What to do when get notified
    alert(evt.payload.alert);
});
Can I assume you are cutting-and-pasting this code from a more complete example?

— answered 10 months ago by Aaron Saunders
answer permalink
2 Comments
  • sorry,

    the code i have is this :

    CloudPush.addEventListener('callback', function (evt) {
                //What to do when get notified
                alert(evt.payload.alert);
            });
    and it doesn't work.. thanks

    — commented 10 months ago by Djamel ZAHAL

  • when i display evt.payload it displays all the json content...

    — commented 10 months ago by Djamel ZAHAL

Your Answer

Think you can help? Login to answer this question!