开发者

Accessing JSON Extras in Urban Airship for Android

开发者 https://www.devze.com 2023-03-20 14:50 出处:网络
I saw this link on Urban Airship\'s website, stating that C2DM pushes require the new JSON key/value pair configuration: http://support.urbanairship.com/customer/portal/articles/79134-sending-extras-i

I saw this link on Urban Airship's website, stating that C2DM pushes require the new JSON key/value pair configuration: http://support.urbanairship.com/customer/portal/articles/79134-sending-extras-in-your-android-push

My question i开发者_如何学编程s, how do I access these extras inside my IntentReceiver? All of the API references I can find refer to the old string-based method of sending extras.


The extra data can also be accessed from the UrbanAirship Inbox

RichPushMessage message =

UAirship.shared().getRichPushManager().getRichPushInbox().getMessage(messageId);

    if(message != null)
    {
    JSONObject jobj = message .getRawMessageJSON(); 

 try {

    JSONObject jobj1 = new JSONObject();
        jobj1 = jobj.getJSONObject("extra");

} catch(Exception e) { }

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号