Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and James Bligh committed Sep 30, 2023
1 parent 017eb6e commit a37d1f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ FCM/GCM and APNS services have slightly different semantics. The app tries to of
The message is only one part of the payload, if
once constructed the payload exceeds the maximum size, an ``APNSDataOverflow`` exception will be raised before anything is sent.
Reference: `Apple Payload Documentation <https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1>`_

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:
Expand All @@ -171,9 +171,9 @@ Simple example:
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.

Expand All @@ -185,13 +185,13 @@ JSON example:
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)
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>`.

Expand Down

0 comments on commit a37d1f8

Please sign in to comment.