{"id":18763795,"url":"https://github.com/roverdotcom/django-device-notifications","last_synced_at":"2025-07-18T13:36:24.646Z","repository":{"id":6614540,"uuid":"7858005","full_name":"roverdotcom/django-device-notifications","owner":"roverdotcom","description":null,"archived":false,"fork":false,"pushed_at":"2014-01-13T19:32:09.000Z","size":495,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":110,"default_branch":"master","last_synced_at":"2025-04-13T04:51:29.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roverdotcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-27T20:59:26.000Z","updated_at":"2014-01-13T19:32:11.000Z","dependencies_parsed_at":"2022-09-12T07:01:30.645Z","dependency_job_id":null,"html_url":"https://github.com/roverdotcom/django-device-notifications","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/roverdotcom/django-device-notifications","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-device-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-device-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-device-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-device-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roverdotcom","download_url":"https://codeload.github.com/roverdotcom/django-device-notifications/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-device-notifications/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265769424,"owners_count":23825267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T18:27:29.020Z","updated_at":"2025-07-18T13:36:24.602Z","avatar_url":"https://github.com/roverdotcom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-device-notifications\n========================\n\n## Before You Start\n\nRead the following tutorial carefully. You should have both `pem` files ready, one for the cert and one for the key.\n\n    http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12\n\n## Dependencies\n\n1. django\n2. python-gcm (https://github.com/geeknam/python-gcm)\n\n\n## Usage\nFirst, you need to add these constants to your `settings.py`. For example,\n\n```python\nINSTALLED_APPS = (\n    # ... other existing apps\n    'device_notifications',\n)\n\nAPN_PASSPHRASE = 'myapncertpassphrase'\nAPN_DEFAULT_APP_ID = 'app'\n```\n\nStore your `cert` and `key` files into the following path:\n\n* certs/ios/production/app-cert.pem\n* certs/ios/production/app-key.pem\n* certs/ios/development/app-cert.pem\n* certs/ios/development/app-key.pem\n\nTo ensure your settings is setup correctly, runs these tests:\n\n```bash\npython manage.py test device_notifications\n```\n\nIf all tests pass, setup is done.\n\nThen, you will need a view to let a iOS app register the `device token` for a user. For example,\n\n```python\n# views.py\n\n@require_POST\ndef add_idevice(request):\n  # ...\n  # add `development=True` if the iOS app is signed \n  # with a development (aka, non distribution) certificate \n  idevice = IDevice(user=recipient, token=token)\n  idevice.save()\n```\n\nEach user may have more than one device.\n\nA push notification message must follow a specific format. You can inspect `device_notification/settings.py` for an example.\n\nHere is an example code to send a push notification:\n\n```python\nfrom device_notifications.settings import IDEVICE_NOTIFICATION_TEMPLATE\nfrom device_notifications.models import IDevice\n\ndef send_notification(request):\n  message = copy.deepcopy(IDEVICE_NOTIFICATION_TEMPLATE)\n  message['aps']['alert']['body'] = 'Hello iPhone User'\n  IDevice.objects.filter(user=receipient).send_message(message)\n```\n\n## License\n\n```\nCopyright (c) 2012-2013, Rover.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this \n  list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, \n  this list of conditions and the following disclaimer in the documentation \n  and/or other materials provided with the distribution.\n  \nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE \nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE \nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL \nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR \nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER \nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, \nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froverdotcom%2Fdjango-device-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froverdotcom%2Fdjango-device-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froverdotcom%2Fdjango-device-notifications/lists"}