1

i'm using new xtify sdk, in which i tried this below code,

  @Override
  public void onMessage(Context context, Bundle msgExtras) {
    Log.i(TAG, "-- Notification recived");
    Log.i(TAG, "Notification Title: "+ msgExtras.getString(NOTIFICATION_TITLE));
    Log.i(TAG, "Notification Content: "+msgExtras.getString(NOTIFICATION_CONTENT));
    Log.i(TAG, "Payload Data "+ msgExtras.getString("listing_id"));
    RichNotificationManger.processNotifExtras(context, msgExtras);
}

in msgExtra,getString("listing_id"), i 'm getting the null value.

Please tell me also that how to pass value of payload with key.

i tried in that,

   payload{"myKey":"myValue"}
Rahul Upadhyay
  • 3,493
  • 2
  • 21
  • 37

2 Answers2

3

In the website try to send the following json in the payload filed :

{"listing_id":"my_listing_id"}

And in the client side this is how you retrieve the data :

  @Override
  public void onMessage(Context context, Bundle msgExtras) {
 msgExtras.getString("listing_id")
}

If you're still having trouble with it, let me know.

Feras
  • 46
  • 1
  • Hi Feras, it isnt working for me ... i am sending a sample test push using the Test Implementation of Xtify, while i am receiving all the values not the payload one .. Let me know if you want any code samples from me – King RV Dec 07 '12 at 13:09
0

With Xtify 2.0, send the following JSON:

{"listing_id":"my_listing_id"}

and on the client side use:

msgExtras.getString("data.listing_id");
user3486184
  • 2,147
  • 3
  • 26
  • 28