mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
modified send push method
This commit is contained in:
@ -112,6 +112,7 @@ def send_notification(notification_type, from_user_id, from_user_type, to_user_i
|
|||||||
|
|
||||||
def send_push(user, data):
|
def send_push(user, data):
|
||||||
""" used to send push notification to specific user """
|
""" used to send push notification to specific user """
|
||||||
|
data['notification_type'] = str(data['notification_type'])
|
||||||
user.fcmdevice_set.filter(active=True).send_message(
|
user.fcmdevice_set.filter(active=True).send_message(
|
||||||
Message(notification=FirebaseNotification(data['title'], data['body']), data=data)
|
Message(notification=FirebaseNotification(data['title'], data['body']), data=data)
|
||||||
)
|
)
|
||||||
@ -119,6 +120,7 @@ def send_push(user, data):
|
|||||||
|
|
||||||
def send_multiple_push(queryset, data):
|
def send_multiple_push(queryset, data):
|
||||||
""" used to send same notification to multiple users """
|
""" used to send same notification to multiple users """
|
||||||
|
data['notification_type'] = str(data['notification_type'])
|
||||||
FCMDevice.objects.filter(user__in=queryset, active=True).send_message(
|
FCMDevice.objects.filter(user__in=queryset, active=True).send_message(
|
||||||
Message(notification=FirebaseNotification(data['title'], data['body']), data=data)
|
Message(notification=FirebaseNotification(data['title'], data['body']), data=data)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user