Hi Maryna:
hello:
Is this right?
What code should I add?
Your what could explain me step by step.
I'm so sorry.
thanks
I add in localstorge variable this code:
try {
var arr = JSON.parse(localStorage.getItem("savepush"));
if ({}.toString.call(arr) !== "[message]") {
alert("alert");
}
} catch ( e ) {
alert("Parse Error. e);
}
but I don't know to add "On Push Notification event add Run JavaScript action"
Hello! Working on it.
Thank you!!!!!!
To save push message into localStorage variable add the following code on Push notification event:
prevar savedMessages;
try {
savedMessages = JSON.parse(localStorage.getItem("savedMessages"));
if ({}.toString.call(savedMessages) !== "[object Array]") {
savedMessages = [];
}
} catch ( e ) {
savedMessages = [];
}
savedMessages.push(data.aps.alert);
localStorage.setItem("savedMessages", JSON.stringify(savedMessages));/pre as a result you'll have array of messages as JSON string in localStorage variable.
Hi:
first I've added this code to my localstorage:
To read the local storage I have followed the manual:
http://docs.appery.io/tutorials/build...
But when I test my app:
This is not my last notification.
Code: Select all
Upgradeable? [url=https://d2r1vs3d9006ap.cloudfront.net/s3_images/993116/Captura.PNG?1386095357][img]https://d2r1vs3d9006ap.cloudfront.net/s3_images/993116/Captura_inline.PNG?1386095357[/img] [/url]
Hi Laura,
Could you please clarify, do you have problem with sending or receiving Push Notification?
hi katya:
I have no problems with sending notifications. It works very well.
I need to save the notifications in the screen that I send, so that I can read them after.
Thanks!
Laura,
Try this code please: prelocalStorage.setItem("message", JSON.stringify(data.aps.alert));/pre
Hi:
I put that code in my variable "savedMessage" but it doesn't work!