Page 5 of 6

read push device token

Posted: Wed Dec 04, 2013 10:42 am
by Maryna Brodina

Hello! Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.


read push device token

Posted: Wed Dec 04, 2013 3:36 pm
by Kateryna Grynko

Hi Laura,

1) On page 'Notificaciones' remove service 'sendpush'
2) Create new REST service 'savedMessagesSrv' with the following settings:
Image Image
3) Add this service on page 'Notificaciones', name it as 'savedMessagesService': Image
4) On page 'Notificaciones' add a Grid with a cell and a Label in it.
5) Do the following mapping:Image
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


read push device token

Posted: Wed Dec 04, 2013 6:53 pm
by laura6372139

Hi:

I have followed step by step explanations, but it still does not work.


read push device token

Posted: Thu Dec 05, 2013 2:57 pm
by Maryna Brodina

Hello! Could you clarify what exactly doesn't work? You don't receive push notifications?


read push device token

Posted: Thu Dec 05, 2013 3:24 pm
by laura6372139

Hi Maryna:

I send and receive push notifications perfectly.

But I need to save these notifications on a label in the screen.


read push device token

Posted: Thu Dec 05, 2013 6:04 pm
by Kateryna Grynko

Hi Laura,

Please take a look at here: https://getsatisfaction.com/apperyio/...


read push device token

Posted: Tue Apr 29, 2014 1:59 pm
by irfan

Image

I have done everything u tut but i still can save notification received on my app plzz help thanks


read push device token

Posted: Tue Apr 29, 2014 2:04 pm
by Maryna Brodina

Hello!

Please describe your problem in more details. Wgat have you done and what exactly doesn't work? How to reproduce your problem?


read push device token

Posted: Tue Apr 29, 2014 2:20 pm
by irfan

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


read push device token

Posted: Tue Apr 29, 2014 5:22 pm
by Maryna Brodina

Hi Ifran,

Could you clarify what code do you run to save message? On what event?
What tutorial did you follow?