0

When notification received for particular application in Android. User click on that notification. Its open app successfully.

What i need to know is that it carry 'Bundle' with it. Can someone help to read it

    {
   "to":"xyz",
   "notification":{
      "body":"Congratulations !!",
      "title":"abc",
      "icon":"myicon",
      "sound":"mySound",
      "badge":"5"
   },
   "payload":{
      "aps":{
         "alert":{
            "type":"gallery_listing",
            "sub_type":"approval_of_selfie",
            "notif_header":"Approval of Selfie",
            "notif_message":"Congratulations your selfie is approved",
            "notif_id":"12345",
            "image_path":""
         }
      }
   }
    }



 Intent intent = this.getIntent();
     if (intent != null && intent.getExtras() != null && (intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
        Log.d("sk_log", "Notification ===1======="+intent.getExtras().get("notification"));
        }
Shadab Khan
  • 93
  • 1
  • 9

1 Answers1

0

I seems that you want to see all the available keys inside an Intent/Bundle. You can see your answer at the following links:

Listing all extras of an Intent

Hope this will help you.

Hari N Jha
  • 484
  • 1
  • 3
  • 11