Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.

— asked March 22nd 2010 by Ahsan Habib
3 Comments
  • solved?

    — commented March 29th 2011 by Tobias O.
  • and how have you solved this ? could be interesting for others to "in example ME :-) "

    — commented August 2nd 2011 by Hansjuerg Wuethrich
  • I have the exact same problem.. did you solve it somehow?

    — commented January 8th 2013 by vincent c

2 Answers

  • Can you post the full code of the RegisterForPushNotification?

    — answered October 14th 2011 by Samuele Coppedè
    permalink
    0 Comments
  • 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

    — answered February 20th 2012 by Moiz Chhatriwala
    permalink
    1 Comment
    • Hi Moiz can u tell me to implement push notification in Android using C2DM(step by step implementation)

      — commented March 14th 2012 by sugan s
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.