notifiable-apns-grocer 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f98e571808f87e99bf9f26f34d31e76aa25aa5b
4
- data.tar.gz: 5ef965c6a92674148da9b9ef5e17cd338ac1753c
3
+ metadata.gz: 4fb5b4d4204409750bec9061b05d34c2476cb154
4
+ data.tar.gz: b9996430ce446adf4f0c8adf05688392b26da5f0
5
5
  SHA512:
6
- metadata.gz: 69e74a7cbafbd3fae7ec9356bceeba1fd547eaaf03e4f86f3c93b1670796ea4fb7d1a4a61e74179dcd5240e2f67a375eb8690e3e7d34469ae95ff6186c9778ea
7
- data.tar.gz: 13a79028ce58615c5dddc3134c0c0743f127418eb29750986208e9038d11bd96410a0510fe11abd2869c9a95f94b832505b84c29b473c60e7b4c86711fd7240f
6
+ metadata.gz: 6fe71cfbdd8bd0169147d3e258504123a5ca74493354c7a51655cb1b873a3ff7cd3b6b4ae82c292cd6471fe2f990b0e0c9093bb78ed1afe18410c746ba5035f8
7
+ data.tar.gz: b1d431a6628fa757b0339a7dea16bf6a34823dcbec61c5aa370dd3f01a61d14fe81b04c0dfd49702749b8e1deafb3b5ff3e9f106b6d31e0a115532e2498bfe52
@@ -85,8 +85,9 @@ module Notifiable
85
85
  end
86
86
 
87
87
  def grocer_payload(device, notification)
88
- payload = {device_token: device.token, custom: notification.send_params}
89
- payload[:alert] = notification.title ? {title: notification.title, body: notification.message} : notification.message
88
+ payload = {device_token: device.token, custom: notification.send_params, alert: {}}
89
+ payload[:alert][:title] = notification.title if notification.title
90
+ payload[:alert][:body] = notification.message if notification.message
90
91
  payload[:sound] = notification.sound if notification.sound
91
92
  payload[:badge] = notification.badge_count if notification.badge_count
92
93
  payload[:identifier] = notification.identifier if notification.identifier
@@ -1,7 +1,7 @@
1
1
  module Notifiable
2
2
  module Apns
3
3
  module Grocer
4
- VERSION = "0.15.0"
4
+ VERSION = "0.15.1"
5
5
  end
6
6
  end
7
7
  end
data/spec/stream_spec.rb CHANGED
@@ -17,7 +17,7 @@ describe Notifiable::Apns::Grocer::Stream do
17
17
 
18
18
  context "message" do
19
19
  let(:n1) { Notifiable::Notification.create! app: a1, message: "New deals!" }
20
- it { expect(@grocer_payload).to include(alert: "New deals!") }
20
+ it { expect(@grocer_payload).to include(alert: {body: "New deals!"}) }
21
21
  it { expect(@grocer_payload).to include(device_token: "abc123") }
22
22
  it { expect(@grocer_payload).to_not include(:sound) }
23
23
  it { expect(@grocer_payload[:custom]).to include(n_id: n1.id) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifiable-apns-grocer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Kocemba
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-21 00:00:00.000000000 Z
12
+ date: 2018-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: notifiable-rails
@@ -185,7 +185,6 @@ files:
185
185
  - lib/notifiable/apns/grocer/stream.rb
186
186
  - lib/notifiable/apns/grocer/version.rb
187
187
  - notifiable-apns-grocer.gemspec
188
- - spec/features/send_notification_spec.rb
189
188
  - spec/fixtures/apns-development.pem
190
189
  - spec/spec_helper.rb
191
190
  - spec/stream_spec.rb
@@ -214,7 +213,6 @@ signing_key:
214
213
  specification_version: 4
215
214
  summary: Notifiable APNS plugin for Grocer
216
215
  test_files:
217
- - spec/features/send_notification_spec.rb
218
216
  - spec/fixtures/apns-development.pem
219
217
  - spec/spec_helper.rb
220
218
  - spec/stream_spec.rb
@@ -1,30 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Send notification" do
4
-
5
- let(:a1) { Notifiable::App.create }
6
- let(:n1) { Notifiable::Notification.create(:app => a1, message: "Test message") }
7
- let(:d1) { Notifiable::DeviceToken.create(:token => "ABC123", :provider => :apns, :app => a1) }
8
-
9
- describe "#add_device_token" do
10
-
11
- before(:each) do
12
- a1.save_notification_statuses = true
13
- a1.apns_certificate = File.read(File.join(File.dirname(__FILE__), "..", "fixtures", "apns-development.pem"))
14
- allow_any_instance_of(Notifiable::Apns::Grocer::Stream).to receive(:gateway_host).and_return("localhost")
15
-
16
- n1.batch do |n|
17
- n.add_device_token(d1)
18
- end
19
-
20
- Timeout.timeout(2) {
21
- @notification = @grocer.notifications.pop
22
- }
23
- end
24
-
25
- it { expect(Notifiable::NotificationStatus.count).to eql 1 }
26
- it { expect(Notifiable::NotificationStatus.first.status).to eql 0 }
27
- it { expect(@notification.alert).to eql "Test message" }
28
- it { expect(@notification.custom[:n_id]).to eql n1.id }
29
- end
30
- end