callback function of push notification
Hi,
I am using Titanium.Network.registerForPushNotifications for push notification. Push is working fine. I receive push notification to my app. I have two problems:
a. The code in callback function is not executing:
callback:function(e)
{
var a = Titanium.UI.createAlertDialog();
a.setMessage("callback: "+Titanium._JSON(e));
a.show();
}
When I receive a push notification, the message is shown as "AppName: message". I put some other texts instead of callback to display, but that does not work.
Could you please let me know how do I get the message that comes with the push notification?
b. I am using Titanium.UI.iPhone.appBadge = null; to reset the push notification badge when the app is launched. It does not work either.
2 Answers
-
Can you post the full code of the RegisterForPushNotification?
-
You may reffer this url and get step by step implementation. This might help you out.
https://wiki.appcelerator.org/display/guides/Push+Notifications+with+Urban+Airship
Thanks