{ "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-push-notifications-manager\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**Note**: Right now, only ``ZeroPush`` is available. More services will\nbe available soon.\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/glemmaPaul/django-push-notifications-manager", "keywords": "django-push-notifications-manager", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-push-notifications-manager", "package_url": "https://pypi.org/project/django-push-notifications-manager/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-push-notifications-manager/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/glemmaPaul/django-push-notifications-manager" }, "release_url": "https://pypi.org/project/django-push-notifications-manager/0.1.1/", "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.1" }, "last_serial": 1526392, "releases": { "0.1.0": [], "0.1.1": [] }, "urls": [] }