我正在向 Google GCM 服务器发送一条消息 (POST),https://android.googleapis.com/gcm/send以便向已注册的 android 设备发送推送通知。POST 正文如下所示:
{
    "registration_ids" : [android_registration_id],
    "data" : {
        "message" : "Hello World!",
        "update" : "You've got a new update",
        "info" : "You've got new information updates too!"
    }
}
假设我不知道在“data”字段中发送给我的所有键值对(gcm 注册的 android 应用程序)并且我想枚举并打印它们,我可以将“data”中的字段提取为JSON结构?
例如,在上面的示例中,我需要以下内容作为 JSON 对象:
{
    "message" : "Hello World!",
    "update" : "You've got a new update",
    "info" : "You've got new information updates too!"
}