Search code examples
phpandroidandroid-c2dm

Track user response in C2DM


I am doing push notification for android using C2DM. it works well. but while receiving message in mobile, user can only view the message.

if we took APNS for iphone as example, user can response to the notification by clicking "view" button or "close" button. by using this i can track the response. Apple Push Notification Service on user response

is it possible to do this in android C2DM? i want to track the user response for the notification like apns.


Solution

  • When you receive your message on your Receiver you can implement to start a new activity whcih looks like a dialog having a View and a Dismiss button and have some cutom functionality in the onClickListeners for each button.

    Let me explain, in your IntentService there must be a method which receives the response from C2DM that is onMessage and this has the params Context and Intent and you can use the Context variable to start a new activity(or a AlertDialog) which has a theme dialog and has the two buttons and do what I said in the above para.