Android C2DM, integrated with Celery
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
android
example_android_project
.gitignore
LICENSE
README
README.md
requirements.txt
setup.py

README.md

Android C2DM implementation for Django

Copyright (C) 2011 Meevine, Inc, Paul Watts (paulcwatts@gmail.com)

This implements the Android C2DM protocol as a reusable Django app. Unlike other implementations, this provides for an exponential backoff retry on failure, and mark device errors.

This integrates with celery for asynchronous messaging.

Settings

This app requires one setting: ANDROID_C2DM_AUTH_TOKEN.

Set this to the C2DM token you get from Google (script to perhaps come soon).

Integration with Celerybeat

Android C2DM sending requires a celerybeat scheduled task in order to retry failed messages. Add this to your CELERYBEAT_SCHEDULE setting:

from datetime import timedelta

CELERYBEAT_SCHEDULE = {
    "c2dm-push": {
        "task": "android.tasks.c2dm_push",
        "schedule": timedelta(minutes=2),
    }
}

You may increase the time delta for the repeating task. However, if you use Device.send_message your messages may be delayed by the time it takes to run the scheduled task. For faster delivery, consider using Device.send_message_immediate.