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

Overriding the send function in api.GCMMessage #24

Closed mevinbabuc closed 9 years ago

mevinbabuc commented 9 years ago

I would like to add a few optional arguments to the

    values = {
        'registration_ids': regs_id,
        'collapse_key': collapse_key,
        'data': data
    }

How can I do that ?. Is there an easy way to override this ?

bogdal commented 9 years ago

Yeah, additional parameters may be important so I have added the ability to easily add them. Check the new 1.0.6 version out.

An example of usage:

from gcm.models import get_device_model
Device = get_device_model()

Device.objects.all().send_message('my message', delay_while_idle=True, time_to_live=5)

All kwargs params are added to the values dict.

mevinbabuc commented 9 years ago

Thank you a lot for adding this feature in !

On 6 March 2015 at 03:32, Adam Bogdał notifications@github.com wrote:

Yeah, additional parameters may be important so I have added the ability to easily add them. Check the new 1.0.6 version out.

An example of usage:

from gcm.models import get_device_model Device = get_device_model()

Device.objects.all().send_message('my message', delay_while_idle=True, time_to_live=5)

All kwargs params are added to the values dict.

— Reply to this email directly or view it on GitHub https://github.com/bogdal/django-gcm/issues/24#issuecomment-77461673.

Thank You Mevin Babu,* http://in.linkedin.com/in/mevinbabuc* http://mevinbabuc.in/ http://mevinbabuc.appspot.com/