pusher 1.2.1 → 1.3.0

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: 4dddbeb6188ab760f83d0d98a9d1ca273b38aba2
4
- data.tar.gz: 3641a6bbfc1540cf04c2c8740bc035934ee853b9
3
+ metadata.gz: c1e831ac3f0f169a775554ad2ddc6a17aea81a73
4
+ data.tar.gz: 7ca020917b73d172417a61b6d9faf73c46deef09
5
5
  SHA512:
6
- metadata.gz: ff61f5c8f7eb53bb1b7109b6bcb8420622765aff0090df82f1abcfb4ace24bbf89a9f7c7d76ba8daa5fb3fe0dad7416170beb724e4b2903418403dcac8848582
7
- data.tar.gz: a67ba5a3da031e3011f2f1e56333bd352cdb9317f70d72dfe70931b998428a35662d3ca78b176717fa4064d6097297c364a5cdfc3f57ad4174a56cc35d0bad1b
6
+ metadata.gz: 0c61c1432ef7d9c72806999f069fd29d30dd7f9444230bfd37a2988a9ab5e6378e43ceded1f40e4323b6825ad3151c5ab5c2e1ec2e8bd698b19c6851592562c6
7
+ data.tar.gz: 66fe450f040e212decc89a99b91d12525dace37efa347f612e7bdbc271c9eed0a471427c907345aa09206f26fd2c24fa86f86c5d55518682bbbd9fa5cfdfc408
@@ -1,4 +1,9 @@
1
1
 
2
+ 1.3.0 / 2016-08-23
3
+ ==================
4
+
5
+ * Add support for sending push notifications on up to 10 interests.
6
+
2
7
  1.2.1 / 2016-08-22
3
8
  ==================
4
9
 
data/README.md CHANGED
@@ -262,7 +262,7 @@ The native notifications API is hosted at `nativepush-cluster1.pusher.com` and o
262
262
 
263
263
  You can send pushes by using the `notify` method, either globally or on the instance. The method takes two parameters:
264
264
 
265
- - `interests`: An Array of strings which represents the interests your devices are subscribed to. These are akin to channels in the DDN with less of an epehemeral nature. Note that currently, you can only send to _one_ interest.
265
+ - `interests`: An Array of strings which represents the interests your devices are subscribed to. These are akin to channels in the DDN with less of an epehemeral nature. Note that currently, you can only publish to, at most, _ten_ interests.
266
266
  - `data`: The content of the notification represented by a Hash. You must supply either the `gcm` or `apns` key. For a detailed list of the acceptable keys, take a look at the [iOS](https://pusher.com/docs/push_notifications/ios/server) and [Android](https://pusher.com/docs/push_notifications/android/server) docs.
267
267
 
268
268
  Example:
@@ -42,8 +42,13 @@ module Pusher
42
42
  # @return [String]
43
43
  def payload(interests, data)
44
44
  interests = Array(interests).map(&:to_s)
45
- raise Pusher::Error, "Too many interests provided" if interests.length > 1
46
- data = deep_symbolize_keys!(data).merge(interests: interests)
45
+
46
+ raise Pusher::Error, "Interests array must not be empty" if interests.length == 0
47
+
48
+ data = deep_symbolize_keys!(data)
49
+
50
+ data.merge!(interests: interests)
51
+
47
52
  MultiJson.encode(data)
48
53
  end
49
54
 
@@ -1,3 +1,3 @@
1
1
  module Pusher
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -550,7 +550,7 @@ describe Pusher do
550
550
  expect(@client.notification_host).to eq(@client.notification_client.host)
551
551
  end
552
552
 
553
- it "should raise an error if more than one interest is provided" do
553
+ it "should raise an error if no interest is provided" do
554
554
  payload = {
555
555
  gcm: {
556
556
  notification: {
@@ -560,7 +560,7 @@ describe Pusher do
560
560
  }
561
561
  }
562
562
 
563
- expect { @client.notify(["test1", "test2"], payload) }.to raise_error(Pusher::Error)
563
+ expect { @client.notify([], payload) }.to raise_error(Pusher::Error)
564
564
  end
565
565
 
566
566
  it "should send a request to the notifications endpoint" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pusher
@@ -186,12 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.6.2
189
+ rubygems_version: 2.4.5.1
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Pusher API client
193
- test_files:
194
- - spec/channel_spec.rb
195
- - spec/client_spec.rb
196
- - spec/spec_helper.rb
197
- - spec/web_hook_spec.rb
193
+ test_files: []