multiple push notification from gcm device

25 views
Skip to first unread message

Revan M

unread,
Aug 8, 2022, 6:38:32 PM8/8/22
to Django users
Hi I am new to Django I am sending push notifications from gcm device but that user account or phone number is logged in multiple devices so now i am getting multiple gcmdevice register id i want to send only single notification for that fcm/gcm device recently active device how to get recent gcmdevice registration id....... here is below code snippet 
fcm_devices = self.friend.gcmdevice_set.all()
        for fcm_device in fcm_devices:
            if fcm_device:
                print(f'73-------------',fcm_device)
                try:
                    push_notification = Notification()
                    if code_version_data:
                        push_notification.send_push_notification(fcm_device, message,type_of_content, title, module, object_info,code_version_data)
                    else:
                        push_notification.send_push_notification(fcm_device, message, type_of_content, title, module, object_info)
                except Exception as e:
                    print(e)
                    pass

Reply all
Reply to author
Forward
0 new messages