|
|
@ -14,14 +14,12 @@ def send_notification(notification):
|
|
|
|
'title': notification.title,
|
|
|
|
'title': notification.title,
|
|
|
|
'body': mark_safe(notification.message),
|
|
|
|
'body': mark_safe(notification.message),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sound = "default"
|
|
|
|
|
|
|
|
if notification.image:
|
|
|
|
if notification.image:
|
|
|
|
FCMDevice.objects.send_message(
|
|
|
|
FCMDevice.objects.send_message(
|
|
|
|
Message(notification=NotificationFB(
|
|
|
|
Message(notification=NotificationFB(
|
|
|
|
title=notification_data['title'],
|
|
|
|
title=notification_data['title'],
|
|
|
|
body=notification_data['body'],
|
|
|
|
body=notification_data['body'],
|
|
|
|
image= notification.image,
|
|
|
|
image= notification.image,
|
|
|
|
sound=sound
|
|
|
|
|
|
|
|
), data={"image": notification.image})
|
|
|
|
), data={"image": notification.image})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -29,7 +27,6 @@ def send_notification(notification):
|
|
|
|
Message(notification=NotificationFB(
|
|
|
|
Message(notification=NotificationFB(
|
|
|
|
title=notification_data['title'],
|
|
|
|
title=notification_data['title'],
|
|
|
|
body=notification_data['body'],
|
|
|
|
body=notification_data['body'],
|
|
|
|
sound=sound
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|