From 48336624150bbdbed7e83d3e0e0fd77fc6b54f19 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Sat, 11 May 2019 14:46:47 +0200 Subject: [PATCH] Use data channel instead of notification, so the notification can get delivered and intercepted client-side --- app/models/notification.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index d9a2c27..8443e62 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -36,12 +36,9 @@ class Notification < ActiveRecord::Base n = Rpush::Gcm::Notification.new n.app = Rpush::Gcm::App.find_by_name("tappb") n.registration_ids = user.android_device_registration_tokens.all.map{|r| r.token} - n.data = { message: message } + n.data = { body: message, title: "Tabbp notification" } n.priority = 'high' n.content_available = true - n.notification = { body: message, - title: "Tabbp notification", - } n.save!