Skip to content

Commit 307a1b8

Browse files
Add silent notification example for GCMDevice (#698)
Co-authored-by: Jamaal Scarlett <jamaal.scarlett@gmail.com>
1 parent 31c88d7 commit 307a1b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ FCM/GCM and APNS services have slightly different semantics. The app tries to of
151151
# but for more complex nested collections the extras dict will be sent via
152152
# the bulk message api.
153153
device.send_message(None, extra={"foo": "bar"})
154-
# You may also pass a Firebase message object.
154+
device.send_message(None, extra={"foo": "bar"}, use_fcm_notifications=False) # Silent message with custom data.
155+
156+
# You may also pass a Firebase message object.
155157
device.send_message(messaging.Message(
156158
notification=messaging.Notification(
157159
title='Hello World',
@@ -160,7 +162,6 @@ FCM/GCM and APNS services have slightly different semantics. The app tries to of
160162
))
161163
# If you want to use gcm.send_message directly, you will have to use messaging.Message.
162164
163-
164165
device = APNSDevice.objects.get(registration_id=apns_token)
165166
device.send_message("You've got mail") # Alert message may only be sent as text.
166167
device.send_message(None, badge=5) # No alerts but with badge.

0 commit comments

Comments
 (0)