From 307a1b80ef94e564e5e897fd6a79ae3389352594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0shak=20Okutan?= Date: Fri, 23 Feb 2024 04:00:10 +0300 Subject: [PATCH] Add silent notification example for GCMDevice (#698) Co-authored-by: Jamaal Scarlett --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2ffdc6d5..7e0d691e 100644 --- a/README.rst +++ b/README.rst @@ -151,7 +151,9 @@ FCM/GCM and APNS services have slightly different semantics. The app tries to of # but for more complex nested collections the extras dict will be sent via # the bulk message api. device.send_message(None, extra={"foo": "bar"}) - # You may also pass a Firebase message object. + device.send_message(None, extra={"foo": "bar"}, use_fcm_notifications=False) # Silent message with custom data. + + # You may also pass a Firebase message object. device.send_message(messaging.Message( notification=messaging.Notification( title='Hello World', @@ -160,7 +162,6 @@ FCM/GCM and APNS services have slightly different semantics. The app tries to of )) # If you want to use gcm.send_message directly, you will have to use messaging.Message. - device = APNSDevice.objects.get(registration_id=apns_token) device.send_message("You've got mail") # Alert message may only be sent as text. device.send_message(None, badge=5) # No alerts but with badge.