Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some Queries on C2DM in Android

I am currently working on one android application which has C2DM implementation and I successfully implemented it. But Now I have problem in sending message to multiple devices.

As per my understanding following will be process for it:

  1. Save reg id & authcode in database (Suppose in c2dm table)
  2. Send message with a loop to all the data from c2dm.

But problem is:

every time I start application it ask for reg id & send it to server so if one device register 10 times the above loop will fail 9 times & works one time & this will make very large database which is not useful.

Does anyone know to what will be server side code (I am using PHP) when we want to send message to all device using my application & how I should save reg_id & authcode in database.

Thank You

like image 500
Sandip Jadhav Avatar asked Nov 11 '11 06:11

Sandip Jadhav


1 Answers

My solution has just been to mark records as deleted in my database if Google gives me a response indicating that it's an invalid registration or no longer registered. Then it only fails once for a given registration.

like image 70
BenTobin Avatar answered Oct 14 '22 05:10

BenTobin