Skip to content

Commit

Permalink
Add priority as notification parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sokre95 committed Nov 5, 2021
1 parent d3ca591 commit 58dfae0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/onesignal/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def initialize **params
@email_subject = params[:email_subject]
@email_body = params[:email_body]
@send_after = params[:send_after].to_s
@priority = params[:priority]
@attachments = params[:attachments]
@filters = params[:filters]
@sounds = params[:sounds]
Expand Down
3 changes: 3 additions & 0 deletions spec/onesignal/notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
context 'json' do
let(:segments) { [build(:segment), build(:segment)] }
let(:time) { Time.now }
let(:priority) { 10 }
let(:filters) do
[Filter.last_session.lesser_than(2).hours_ago!,
Filter.session_count.equals(5),
Expand All @@ -37,6 +38,7 @@
included_segments: segments,
excluded_segments: segments,
send_after: time,
priority: priority,
filters: filters,
sounds: sounds,
included_targets: targets,
Expand All @@ -50,6 +52,7 @@
'contents' => contents.as_json,
'headings' => headings.as_json,
'send_after' => time.to_s,
'priority' => priority,
'included_segments' => segments.as_json,
'excluded_segments' => segments.as_json,
'data' => subject.attachments.data.as_json,
Expand Down

0 comments on commit 58dfae0

Please sign in to comment.