read push device token
Hello! Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hello! Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.
Hi Laura,
1) On page 'Notificaciones' remove service 'sendpush'
2) Create new REST service 'savedMessagesSrv' with the following settings:
3) Add this service on page 'Notificaciones', name it as 'savedMessagesService':
4) On page 'Notificaciones' add a Grid with a cell and a Label in it.
5) Do the following mapping:
6) On Page Show event run the following code:prevar savedMessages;
try {
savedMessages = JSON.parse(localStorage.getItem("savedMessages"));
if ({}.toString.call(savedMessages) !== "[object Array]") {
savedMessages = [];
}
} catch ( e ) {
savedMessages = [];
}
savedMessagesSrv.requestOptions.echo = '{"messages": ' + JSON.stringify(savedMessages) + '}';
try {
savedMessagesService.execute({})
} catch (ex) {
console.log(ex.name + ' ' + ex.message);
hideSpinner();
};/pre
7) On Push notification event run the following code instead of current one:
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));
savedMessagesSrv.requestOptions.echo = '{"messages": ' + JSON.stringify(savedMessages) + '}';
try {
savedMessagesService.execute({})
} catch (ex) {
console.log(ex.name + ' ' + ex.message);
hideSpinner();
};/pre
Hi:
I have followed step by step explanations, but it still does not work.
Hello! Could you clarify what exactly doesn't work? You don't receive push notifications?
Hi Maryna:
I send and receive push notifications perfectly.
But I need to save these notifications on a label in the screen.
Hi Laura,
Please take a look at here: https://getsatisfaction.com/apperyio/...
Hello!
Please describe your problem in more details. Wgat have you done and what exactly doesn't work? How to reproduce your problem?
Good Day Maryna!
Hope you are good today
My Target?
I am trying to read received push notifications inside my app (once i click on oush notification from notification bar from phone it should open up in a page and show me received push message i just received.)
What i have achieved so far
i can send notification from server to my phone(android) work great following ur tutoria.
i have attached the screen shorts above for the ur concerns all the services i added mapping aja Json script.
Thanks
Hi Ifran,
Could you clarify what code do you run to save message? On what event?
What tutorial did you follow?