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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/pusher/native_notification/client.rb +7 -2
- data/lib/pusher/version.rb +1 -1
- data/spec/client_spec.rb +2 -2
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1e831ac3f0f169a775554ad2ddc6a17aea81a73
|
4
|
+
data.tar.gz: 7ca020917b73d172417a61b6d9faf73c46deef09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c61c1432ef7d9c72806999f069fd29d30dd7f9444230bfd37a2988a9ab5e6378e43ceded1f40e4323b6825ad3151c5ab5c2e1ec2e8bd698b19c6851592562c6
|
7
|
+
data.tar.gz: 66fe450f040e212decc89a99b91d12525dace37efa347f612e7bdbc271c9eed0a471427c907345aa09206f26fd2c24fa86f86c5d55518682bbbd9fa5cfdfc408
|
data/CHANGELOG.md
CHANGED
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
|
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
|
-
|
46
|
-
|
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
|
|
data/lib/pusher/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -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
|
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([
|
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.
|
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.
|
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: []
|