Commit a79e1e53 authored by Luko van der Maas's avatar Luko van der Maas
Browse files

add data parameter for pushnotifications and make use of url in events

pushnotifications
parent 76e11ca9
......@@ -301,6 +301,9 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
registration_reminder.category = Category.objects.get(
key='event')
registration_reminder.time = registration_reminder_time
registration_reminder.url = reverse("events:event",
args=[self.id])
registration_reminder.save()
self.registration_reminder = registration_reminder
self.registration_reminder.users.set(
......
......@@ -140,8 +140,9 @@ class Message(models.Model, metaclass=ModelTranslateMeta):
any_reg_ids = True
data = {}
if self.url is not None:
kwargs['click_action'] = self.url
data['url'] = self.url
result = FCMNotification(
api_key=settings.PUSH_NOTIFICATIONS_API_KEY
......@@ -151,6 +152,7 @@ class Message(models.Model, metaclass=ModelTranslateMeta):
message_body=str(self.body),
color='#E62272',
sound='default',
data_message=data,
**kwargs
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment