-2

I would like to implement a feature that only delivers messages to devices at specific periods. After the valid time, messages would be abandoned. Can anyone suggest me how to do this?

koopaking3
  • 3,375
  • 2
  • 25
  • 36
natanovia
  • 3
  • 2
  • You should do some research first and go through a tutorial, [like this](http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html). Then come back here with a specific question and show your code where you are having problems. – koopaking3 Mar 08 '12 at 02:29

2 Answers2

1

C2DM itself doesn't have such a facility so you have two choices:

  1. Your server app only sends messages during certain times or
  2. Your Android app receives the C2DM messages all the time, but during certain times you ignore/handle as appropriate.
Ollie C
  • 28,313
  • 34
  • 134
  • 217
0

Google just released a new version of c2dm called "Google Cloud Messaging (GCM)" at I/O 2012. With GCM its possible to define a timeout for your messages.

GCM ttl section: http://developer.android.com/guide/google/gcm/adv.html#ttl

You can find my answer to a similiar question here: https://stackoverflow.com/a/9709944/789738

Community
  • 1
  • 1
Domi
  • 1,451
  • 2
  • 13
  • 25