android - Detect when Notification is clicked to send analytic's event -


we have app gcm notifications working fine, set pendingintent activity want open when notification clicked. however, need send event google analytics each time 1 notification (and there different types of notifications) clicked. how achieve this? don't want parse intent in activity, think not solution (we using taskstackbuilder not same activity open same notification), there receiver can use detect when notification clicked/open?

thanks in advance

put flag variable on notification intent.

intent.putextra("notification","clicked"); 

now check in activity, whether bundle having "notification" key or not

if(getintent().hasextra("notification"))     //write code analytics 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -