bogdal / django-gcm

Google Cloud Messaging Server in Django

Home Page:https://django-gcm.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question for dev_id usage.

iskorum opened this issue · comments

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

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).

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);

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

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.