Chore: FCM Notification Improvements (#957)

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose
2020-06-15 13:36:56 +05:30
committed by GitHub
parent 667e3abbe1
commit b0bbd757b5
6 changed files with 71 additions and 9 deletions

View File

@@ -37,11 +37,16 @@ class Notification < ApplicationRecord
enum notification_type: NOTIFICATION_TYPES
after_create_commit :process_notification_delivery
default_scope { order(id: :desc) }
PRIMARY_ACTORS = ['Conversation'].freeze
def push_event_data
{
id: id,
notification_type: notification_type,
primary_actor_type: primary_actor_type,
primary_actor_id: primary_actor_id,
primary_actor: primary_actor&.push_event_data,
read_at: read_at,
secondary_actor: secondary_actor&.push_event_data,