Skip to content Skip to sidebar Skip to footer

How To Know If The App Was Launched By Clicking On The Push Notification

I want to know if there is a flag and parameter that can tell me if the user launched the activity/app by clicking on the push notification in the notification tray. My code in C2D

Solution 1:

Just posting an answer so that people who visit this page get the solution.

You need to use putExtra(ID_KEY,id) when you create your Intent for starting your application, and in your onCreate() method you can use getIntent().getExtras().getInt(ID_KEY); to retrieve your passed id integer.

The passed extra could be anything, a boolean, String etc.

Source - https://stackoverflow.com/a/7358692/3036759

Post a Comment for "How To Know If The App Was Launched By Clicking On The Push Notification"