Page 1 of 2
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Mon May 12, 2014 2:20 am
by Kevin McGuire
I followed push notifications tutorial and have it working but how do I handle these notifications with the app? I just want to add something simple where the user can view the push notification and then the badge clears. I'm a newbie so I need a step by step. 
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Mon May 12, 2014 6:01 am
by Kateryna Grynko
Hi Kevin,
On 'Push notification' event the message is available in a variable data.aps.alert.
Here is an example of clearing badge: https://getsatisfaction.com/apperyio/...
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Tue May 13, 2014 1:45 am
by Kevin McGuire
Hi Katya,
I placed the following on Device Ready Event:
var pushNotification = window.plugins.pushNotification;
pushNotification.setApplicationIconBadgeNumber(successHandler, 0);
Nothing happens, it does not clear the badge. I tried to follow the multiple links in other threads but the only other code I tried kept removing the device from the push database when the app closed. That cleared the badge but I couldn't receive any push message.
Kevin
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Tue May 13, 2014 5:48 pm
by Evgene Karachevtsev
Hello Kevin,
Apparently this bug will be fixed in the next release. Now, as a workaround you can change your library version to v1.2
http://docs.appery.io/documentation/a...
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Tue May 13, 2014 7:45 pm
by Kevin McGuire
My library version is currently set to v1.2 so I don't think that is the problem.
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Tue May 13, 2014 8:44 pm
by Evgene Karachevtsev
Have you defined your successHandler as empty function?
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Fri May 16, 2014 1:58 am
by Kevin McGuire
Uh, no...As I said, I'm a newbie so step by step would be best. I have no idea how to define that as an empty function. Where can I get help with that? I have everything working.... I just want to be able to view the push notification in the app and clear the badge.
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Fri May 16, 2014 8:22 am
by Kateryna Grynko
Hi Kevin,
Add this code before:
prevar successHandler = function(){
//your code here
}/pre
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Fri May 16, 2014 11:09 am
by Kevin McGuire
Thank you for helping. When I put the following code in, not only will it not clear a previous badge but it will not receive any push notifications.
var successHandler = function(){
var pushNotification = window.plugins.pushNotification;
pushNotification.setApplicationIconBadgeNumber(successHandler, 0);
};
On the Appery.io push side the push notification attempt results in an error:
Description: An error response packet was received from the APNS server: APNS: [1] Invalid token
Devices count: 1
Any further suggestions?
Thanks!
Kevin
I have push notifications working, now how do I handle them in the app? Can the user view the push message and clear th
Posted: Fri May 16, 2014 5:50 pm
by Evgene Karachevtsev
Hello Kevin,
Let's try using this code:
codevar successHandler = function(){
//just empty
};
var pushNotification = window.plugins.pushNotification;
pushNotification.setApplicationIconBadgeNumber(successHandler, 0); /code