bogdal / django-gcm

Google Cloud Messaging Server in Django
https://django-gcm.readthedocs.org
BSD 2-Clause "Simplified" License
98 stars 42 forks source link

Question for dev_id usage. #13

Closed iskorum closed 10 years ago

iskorum commented 10 years ago

In model why dev_id is unique but reg_id is not? And what is dev_id for? And reg_id is TextField, why?

bogdal commented 10 years ago

Hi @iskorum. Good point. reg_id should be unique and have the same field type as dev_id.

dev_id gives us information about which device we want to register/unregister (particularly useful when we have multiple devices).

osrl commented 10 years ago

This is how you get dev_id on Android side @iskorum :

    import android.provider.Settings.Secure;
    ...
    String deviceID = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
iskorum commented 10 years ago

Hi @bogdal and @osrl Thank you for your answers. And I think reg_id musn't be null too?

bogdal commented 10 years ago

Yeah, I agree with you @iskorum.

btw. I didn't find any information about the maximum length for reg_id in the google documentation. I think it's better to leave the field type as now.