lib/pushpad/notification.rb in pushpad-0.12.0 vs lib/pushpad/notification.rb in pushpad-0.13.0

- old
+ new

@@ -10,11 +10,11 @@ end class ReadonlyError < RuntimeError end - attr_accessor :body, :title, :target_url, :icon_url, :image_url, :ttl, :require_interaction, :silent, :urgent, :custom_data, :custom_metrics, :actions, :starred, :send_at + attr_accessor :body, :title, :target_url, :icon_url, :badge_url, :image_url, :ttl, :require_interaction, :silent, :urgent, :custom_data, :custom_metrics, :actions, :starred, :send_at attr_reader :id, :created_at, :scheduled_count, :successfully_sent_count, :opened_count def initialize(options) @id = options[:id] @created_at = options[:created_at] && Time.parse(options[:created_at]) @@ -24,10 +24,11 @@ @body = options[:body] @title = options[:title] @target_url = options[:target_url] @icon_url = options[:icon_url] + @badge_url = options[:badge_url] @image_url = options[:image_url] @ttl = options[:ttl] @require_interaction = options[:require_interaction] @silent = options[:silent] @urgent = options[:urgent] @@ -114,9 +115,10 @@ def req_body(uids = nil, tags = nil) notification_params = { "body" => self.body } notification_params["title"] = self.title if self.title notification_params["target_url"] = self.target_url if self.target_url notification_params["icon_url"] = self.icon_url if self.icon_url + notification_params["badge_url"] = self.badge_url if self.badge_url notification_params["image_url"] = self.image_url if self.image_url notification_params["ttl"] = self.ttl if self.ttl notification_params["require_interaction"] = self.require_interaction unless self.require_interaction.nil? notification_params["silent"] = self.silent unless self.silent.nil? notification_params["urgent"] = self.urgent unless self.urgent.nil?