Beispiel #1
0
def createNotification(message, notification_type, custom_payload=False, recipients=[]):
	service = APNService.objects.get(hostname='gateway.sandbox.push.apple.com', name='sandbox')
	notification = Notification(message=message, service=service)
	if custom_payload:
		notification.custom_payload = custom_payload
	notification.badge = None
	notification.notification_type = notification_type
	notification.save()
	for recipient in recipients:
		notification.recipients.add(recipient)
	return notification