Titanium Community Questions & Answer Archive

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

Push Notification recive Data

Hi guys,

i send this via push notification to the device:

{"aps":{"alert":"This is the alert text","badge":1,"sound":"default"},"server":{"serverId":"1","name":"test"}}

with the callback in Ti:

    callback:function(e)
    {
        // called when a push notification is received.
        alert(JSON.stringify(e.data));
    }

i only get this:

{"alert":"This is the alert text","badge":1,"sound":"default"}

Any ideas how to solve the problem and get the 'server' objekt

— asked September 27th 2010 by Carl Jahn
  • notification
  • push
0 Comments

4 Answers

  • You need to move the server object inside the aps array as follows:

    {"aps":{"alert":"This is the alert text","badge":1,"sound":"default","server":{"serverId":"1","name":"test"}}}
    
    — answered October 6th 2010 by Derrick Huth
    permalink
    1 Comment
    • You are right, thanks

      — commented December 3rd 2010 by Ding Hua
  • But how can I retrieve the server property?

    — answered December 3rd 2010 by Ding Hua
    permalink
    1 Comment
    • callback:function(e) {
      
              alert(e.data.serverId);
      
              }
      

      — commented August 5th 2011 by Caio Iglesias
  • -subscribing-

    — answered December 3rd 2010 by danno watts
    permalink
    0 Comments
  • But how can I retrieve the server property?

    — answered December 3rd 2010 by Ding Hua
    permalink
    0 Comments
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.