{ "info": { "author": "Paul Oostenrijk", "author_email": "paul@glemma.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "Django Push Notifications\n=========================\n\nThis package makes it easy to support Push notifications. It works\ntogether with third party services such as ``ZeroPush``.\n\nYou can easily add permissions to push devices by chaining those devices\nto a notification setting. For registering a new push device you can add\ncustom permissions.\n\nInstallation\n------------\n\nTo install the package on your machine you can run the PIP install:\n\n::\n\n pip install django-pnm\n\nConfiguration\n-------------\n\nFirst you have to add ``push_notifications`` to your installed apps:\n\n.. code:: python\n\n INSTALLED_APPS = (\n ...\n 'push_notifications',\n )\n\nTo setup the package you have to add a ``DJANGO_PUSH_NOTIFICATIONS``\ninto your settings:\n\n.. code:: python\n\n def Settings(Configuration):\n # ...\n DJANGO_PUSH_NOTIFICATIONS = {\n 'SERVICE': 'push_notifications.services.zeropush.ZeroPushService',\n 'AUTH_TOKEN': '123123123'\n }\n\nThe ``SERVICE`` Key can be set to the type of service you use. In this\nexample we use the ``ZeroPushService``. With the ``ZeroPush`` Service we\nare required to add a ``AUTH_TOKEN`` to the ``Configuration``.\n\n\nDon't forget to run the migrations\n~~~~~~~~~~~~~~~\nThen run the migrations by running: ``python manage.py migrate``\n\n\n**Note**: Right now, only ``ZeroPush`` is available. More services will\nbe available soon.\n\nDjango REST Framework support\n-------------\n\nThere are also 2 endpoints for you available. These can be used to register and unregister a push device. The endpoints are Auth protected with the default settings of your Django REST Framework set up.\n\nTo enable the ``unregister`` and ``register`` endpoints you can add the following to your ``urls.py`` file:\n\n.. code:: python\n url(r'^notifications/', include('push_notifications.urls')),\n\n\nUsage\n-----\n\nRegister a device\n~~~~~~~~~~~~~~~~~\n\nTo register a new device you can use the ``register_push_device`` method\nin ``utils``:\n\n.. code:: python\n\n from push_notifications.utils from register_push_device\n\n token = \"\"\n register_push_device(user, token)\n\nYou can also pass notification permissions directly to the\n``register_push_device`` method:\n\n.. code:: python\n\n register_push_device(user, token, ['likes', 'comments'])\n\nAdd permissions\n~~~~~~~~~~~~~~~\n\nTo add an notification permission to a push device you can use the\n``add_permission`` method on the ``device`` object:\n\n.. code:: python\n\n device.add_permission('likes')\n\nOr adding multiple permissions\n\n.. code:: python\n\n device.add_permissions(['likes', 'comments'])\n\nAdd all the permission for the devices that the user owns.\n\n.. code:: python\n\n user.push_devices.add_permissions(['likes', 'comments'])\n\nRemove permissions\n~~~~~~~~~~~~~~~~~~\n\nTo remove a notification permission you can use ``remove_permission``\nmethod on the ``device`` object:\n\n.. code:: python\n\n device.remove_permissions('likes')\n\nOr removing multiple permissions\n\n.. code:: python\n\n device.remove_permissions(['likes', 'comments'])\n\nRemove all the permission for the devices that the user owns.\n\n.. code:: python\n\n user.push_devices.remove_permissions(['likes', 'comments'])\n\nSend a notification\n~~~~~~~~~~~~~~~~~~~\n\nTo send a notification to a certain permission group you can call\n``send_push_notification`` in ``utils``:\n\n.. code:: python\n\n from push_notifications import send_push_notification\n from datetime import timedelta\n\n send_push_notification('likes', 'This is the message', sound=\"annoyingSound.mp3\",\n badge_number=1\n info={\n \"extra\": \"payload\",\n \"in\": \"notification\"\n },\n expiry=timedelta(days=30))\n\nDescription\n^^^^^^^^^^^\n\n``send_push_notification(notify_type, message, **kwargs)``\n\n**kwargs** - ``sound``: The sound that has to be played when sending the\nnotification - ``badge_number``: The badge\\_number that has to be\ndisplayed **(iOS Only)** - ``info``: Extra payload that comes along the\nnotification - ``expiry``: The expiry of the notification **Accepts\ntimedelta and datetime object**\n\nSend a notification to one device\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo send a notification to a specific device you can use the\n``send_push_notification`` on the ``device`` object\n\n.. code:: python\n\n device.send_push_notification('likes', 'This is the message', sound=\"annoyingSound.mp3\",\n badge_number=1\n info={\n \"extra\": \"payload\",\n \"in\": \"notification\"\n },\n expiry=timedelta(days=30))\n\nIt accepts the same parameters as the global ``send_push_notification``\nin ``utils``.\n\nSend a notification to one user\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo send a notification to a user and all its devices you can use the\n``send_push_notification`` on the ``push_devices`` name in your user\nobject:\n\n.. code:: python\n\n user.push_devices.send_push_notification('likes', 'This is the message',\n sound=\"annoyingSound.mp3\",\n badge_number=1\n info={\n \"extra\": \"payload\",\n \"in\": \"notification\"\n },\n expiry=timedelta(days=30))", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Fueled/django-push-notifications", "keywords": "pnm,django,push,notifications,manager", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "dpnm", "package_url": "https://pypi.org/project/dpnm/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dpnm/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Fueled/django-push-notifications" }, "release_url": "https://pypi.org/project/dpnm/0.1.7/", "requires_dist": null, "requires_python": null, "summary": "A plug and play package to handle push devices and push notifications for services such as ZeroPush and Urban Airship", "version": "0.1.7" }, "last_serial": 1527098, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "25b6ee7d615acbf5ed421487363cbec2", "sha256": "ad49c9b9c35aca3a653683c841019754c0aa561bb12970fa1fe7a7e0f0a0d62e" }, "downloads": -1, "filename": "dpnm-0.1.1.tar.gz", "has_sig": false, "md5_digest": "25b6ee7d615acbf5ed421487363cbec2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6501, "upload_time": "2015-04-29T20:37:49", "url": "https://files.pythonhosted.org/packages/e1/be/a97a7dfbeb8cca7bdfae1466c7a1262b071e95d13ed6294088ed77ce542c/dpnm-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "91d8576a278d46f22818e2320f1152e1", "sha256": "110650c54e60b5e25d83eacc675ddf4d898fd1ac95882e923b31bf1f27813370" }, "downloads": -1, "filename": "dpnm-0.1.2.tar.gz", "has_sig": false, "md5_digest": "91d8576a278d46f22818e2320f1152e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6595, "upload_time": "2015-04-29T21:40:21", "url": "https://files.pythonhosted.org/packages/0c/68/ce5d25e137dfe484c1f630dd8c486fc559c3bf2dfd8296ce96a07a719311/dpnm-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "fb0b67a82f5982400d5040fdf59b04a8", "sha256": "e42c718114a12ad7d06feea9a963479b70c936bd27b23c90eaef0d3158ba287c" }, "downloads": -1, "filename": "dpnm-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fb0b67a82f5982400d5040fdf59b04a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6617, "upload_time": "2015-04-29T21:42:13", "url": "https://files.pythonhosted.org/packages/99/eb/e1f26ab5c602d11700b3b12fd98d50b8f730934124f04646daf87d9d001b/dpnm-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "398b187eff181496e4f5302701c7cde0", "sha256": "3589808c88ebc76aadba5bb6205a8ef0ed7d97d9013983dc6ac716a5440aaaa0" }, "downloads": -1, "filename": "dpnm-0.1.4.tar.gz", "has_sig": false, "md5_digest": "398b187eff181496e4f5302701c7cde0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6613, "upload_time": "2015-04-29T22:08:49", "url": "https://files.pythonhosted.org/packages/77/a3/7e7ee8386bb06a58f0324c29c63a7928dbcf0a32d2fb85dcc3a6b71056be/dpnm-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "2fb9181bc26c3b94ad01043d7641e779", "sha256": "c67048cb3edcbf99906aca785c9199ebf670f983f074c39afdcd795afdba20eb" }, "downloads": -1, "filename": "dpnm-0.1.5.tar.gz", "has_sig": false, "md5_digest": "2fb9181bc26c3b94ad01043d7641e779", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6583, "upload_time": "2015-04-29T22:15:04", "url": "https://files.pythonhosted.org/packages/9e/33/cf85c62bfe4a7d818eb367b2b11f9a22c83c85b2de1ed6216c57ad88b143/dpnm-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "53467834c074ff4964c6b608e09b013f", "sha256": "c22b8eac688e975e5336b4830aa6adf5b083b702d9488df0cf3824ed658071f6" }, "downloads": -1, "filename": "dpnm-0.1.6.tar.gz", "has_sig": false, "md5_digest": "53467834c074ff4964c6b608e09b013f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6966, "upload_time": "2015-04-29T22:22:41", "url": "https://files.pythonhosted.org/packages/47/23/bf903f8c2f10871b8aef5d274997018b97c25d57b9e15017cdd5d4ab7592/dpnm-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "19cce053c02309dfb1c8d021980cab79", "sha256": "1a7a4656920f5c9b855afae9cb98e8f25fcddb336293d7141986dad5aa33402a" }, "downloads": -1, "filename": "dpnm-0.1.7.tar.gz", "has_sig": false, "md5_digest": "19cce053c02309dfb1c8d021980cab79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7078, "upload_time": "2015-04-29T23:41:44", "url": "https://files.pythonhosted.org/packages/37/b2/afe8955d9d342beb80576c29faab01ed41f69445bd4c97f1735889ff69f1/dpnm-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19cce053c02309dfb1c8d021980cab79", "sha256": "1a7a4656920f5c9b855afae9cb98e8f25fcddb336293d7141986dad5aa33402a" }, "downloads": -1, "filename": "dpnm-0.1.7.tar.gz", "has_sig": false, "md5_digest": "19cce053c02309dfb1c8d021980cab79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7078, "upload_time": "2015-04-29T23:41:44", "url": "https://files.pythonhosted.org/packages/37/b2/afe8955d9d342beb80576c29faab01ed41f69445bd4c97f1735889ff69f1/dpnm-0.1.7.tar.gz" } ] }