Skip to content

Commit

Permalink
@notification.app triggers loading of association :app
Browse files Browse the repository at this point in the history
fixes rpush#410
  • Loading branch information
loadhigh authored and Henry Yang committed Mar 2, 2018
1 parent 75863e6 commit ab673b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rpush/daemon/gcm/delivery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def create_new_notification(response, unavailable_idxs)
attrs = { 'app_id' => @notification.app_id, 'collapse_key' => @notification.collapse_key, 'delay_while_idle' => @notification.delay_while_idle }
registration_ids = @notification.registration_ids.values_at(*unavailable_idxs)
Rpush::Daemon.store.create_gcm_notification(attrs, @notification.data,
registration_ids, deliver_after_header(response), @notification.app)
registration_ids, deliver_after_header(response), @app)
end

def bad_request
Expand Down Expand Up @@ -143,7 +143,7 @@ def retry_message

def do_post
post = Net::HTTP::Post.new(FCM_URI.path, 'Content-Type' => 'application/json',
'Authorization' => "key=#{@notification.app.auth_key}")
'Authorization' => "key=#{@app.auth_key}")
post.body = @notification.as_json.to_json
@http.request(FCM_URI, post)
end
Expand Down

0 comments on commit ab673b8

Please sign in to comment.