Skip to content

Commit

Permalink
Update README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
blighj authored Sep 30, 2023
1 parent df6998f commit 99fca51
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,37 +193,6 @@ JSON example:
device.send_message(data)
Web Push accepts only one variable (``message``), which is passed directly to pywebpush. This message can be a simple string, which will be used as your notification's body, or it can be contain `any data supported by pywebpush<https://github.com/web-push-libs/pywebpush>`.

Simple example:

.. code-block:: python
from push_notifications.models import WebPushDevice
device = WebPushDevice.objects.get(registration_id=wp_reg_id)
device.send_message("You've got mail")
.. note::
To customize the notification title using this method, edit the ``"TITLE DEFAULT"`` string in your ``navigatorPush.service.js`` file.

JSON example:

.. code-block:: python
import json
from push_notifications.models import WebPushDevice
device = WebPushDevice.objects.get(registration_id=wp_reg_id)
title = "Message Received"
message = "You've got mail"
data = json.dumps({"title": title, "message": message})
device.send_message(data)
Sending messages in bulk
------------------------
.. code-block:: python
Expand Down

0 comments on commit 99fca51

Please sign in to comment.