diff --git a/helpers/fcm.py b/helpers/fcm.py index 937bce6..02b7873 100644 --- a/helpers/fcm.py +++ b/helpers/fcm.py @@ -63,7 +63,7 @@ def broadcast_notification(node_shortname=None, data=None, event=NotificationEve logger.info("Sending FCM broadcast...") try: data = data or {} - data["event"] = str(event.title) + data["event"] = str(event.prefix) if not body and not title: silent = True diff --git a/news/views.py b/news/views.py index 553f253..2a72d48 100644 --- a/news/views.py +++ b/news/views.py @@ -42,6 +42,7 @@ def form_valid(self, form): title=news.title, body=news.short_description, image=self.request.build_absolute_uri(news.banner_thumbnail.url) if news.banner_thumbnail.name else None, + data={"id": str(news.pk)} ) return HttpResponseRedirect(self.get_success_url()) diff --git a/offers/views.py b/offers/views.py index 9126451..ce9708a 100644 --- a/offers/views.py +++ b/offers/views.py @@ -63,7 +63,7 @@ def form_valid(self, form): event=NotificationEvent.OFFER_ADDED, title=offer.title, body=offer.description, - data={'proveedora': offer.provider.name}, + data={'proveedora': offer.provider.name, 'id': str(offer.pk)}, image=self.request.build_absolute_uri(offer.banner_thumbnail.url) if offer.banner_thumbnail.name else None, )