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