carbon_pms 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/carbon_pms/client.rb +17 -2
- data/lib/carbon_pms/version.rb +1 -1
- data/spec/carbon_pms/client_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8ae2582f731c7c78fa1303caec5705d14a725d4
|
4
|
+
data.tar.gz: 4f5c2ab38575ca5fae5818db6cc5e713d2fcfe41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab88b988c2ffa66cae63883ce73051c5c23407f0b30d611584fa181bf0b5ec8fc662759194fb65016ffbe98d64a69b66bdbdd55a5f68f02b3677c4a9e133a9e6
|
7
|
+
data.tar.gz: 23c09f383d99bf979bd1513c2d796e295f9071c9c118a28c73665a058d8d20e2143e2eef1d0d13cce85f885833c4c36bbc901bbd4159e8248a73315266d8c1bd
|
data/lib/carbon_pms/client.rb
CHANGED
@@ -55,7 +55,22 @@ module CarbonPms
|
|
55
55
|
# @option options [String] :sound play the specified sound when the notification is received.
|
56
56
|
# @option options [Integer] :content_available notify the device that new content is available
|
57
57
|
def apns_notificaton(options={})
|
58
|
-
return post '/push/apns',
|
58
|
+
return post '/push/apns', body: options
|
59
|
+
end
|
60
|
+
|
61
|
+
# Sends bulk push notifications to the APNS
|
62
|
+
#
|
63
|
+
# @param [Hash] options hash to construct a notification
|
64
|
+
# @option options [Array] :device_token array of device token to receive this push notification
|
65
|
+
# @option options [String] :app the name of the app
|
66
|
+
# @option options [String] :environment the environment this app is running in _(production, development, sandbox)_
|
67
|
+
# @option options [String] :alert the message to send
|
68
|
+
# @option options [Hash] :data any custom attributes to send
|
69
|
+
# @option options [Integer] :badge sets the badge number to the specified number
|
70
|
+
# @option options [String] :sound play the specified sound when the notification is received.
|
71
|
+
# @option options [Integer] :content_available notify the device that new content is available
|
72
|
+
def apns_bulk_notificaton(options={})
|
73
|
+
return post '/push/apns_bulk', body: options
|
59
74
|
end
|
60
75
|
|
61
76
|
# Sends a push notification to GCM
|
@@ -68,7 +83,7 @@ module CarbonPms
|
|
68
83
|
# @option options [String] :collapse_key signifies that this is a send-to-sync message. You can use up to 4 different collapse_keys at a time
|
69
84
|
# @option options [Integer] :expiry set the time to live of the message. Can be from 0 to 2,419,200 seconds.
|
70
85
|
def gcm_notification(options={})
|
71
|
-
return post '/push/gcm',
|
86
|
+
return post '/push/gcm', body: options
|
72
87
|
end
|
73
88
|
|
74
89
|
private
|
data/lib/carbon_pms/version.rb
CHANGED
@@ -31,7 +31,7 @@ describe CarbonPms::Client do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'should set the authorization header if given an auth token' do
|
34
|
-
client.class.headers['Authorization'].should eq 'token
|
34
|
+
client.class.headers['Authorization'].should eq 'Token token="abcdef"'
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'should set the version header if given a version' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carbon_pms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Mason
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|