Use data channel instead of notification, so the notification can get delivered and intercepted client-side

This commit is contained in:
redfast00 2019-05-11 14:46:47 +02:00
parent b037dccd43
commit 4833662415
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C

View file

@ -36,12 +36,9 @@ class Notification < ActiveRecord::Base
n = Rpush::Gcm::Notification.new n = Rpush::Gcm::Notification.new
n.app = Rpush::Gcm::App.find_by_name("tappb") n.app = Rpush::Gcm::App.find_by_name("tappb")
n.registration_ids = user.android_device_registration_tokens.all.map{|r| r.token} 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.priority = 'high'
n.content_available = true n.content_available = true
n.notification = { body: message,
title: "Tabbp notification",
}
n.save! n.save!