carbon_pms 0.0.1 → 0.1.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/README.md +2 -0
- data/lib/carbon_pms/client.rb +16 -1
- data/lib/carbon_pms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3ffdfcb6db5f349446e8275ed8173f3b038365d
|
4
|
+
data.tar.gz: 959bdac39e6429debe347942634e75d799c9a226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ade9d6683be77b8ca93e505b3ba2506bb7597ef47cc186fe48a01c2c2eae2c5a16680860addd85c9695625c6321a64d69618fb44ca6c0fd9269d0d7f100cfd4f
|
7
|
+
data.tar.gz: 555bdc9c51685c1c12c57f0a4ac54e844cf7ecb3336835bf18d7c9e7d3f9aeeef45f5ef02b49924972faa67b9261b7e17a404f6d23c1ff45773de7c485cf9537
|
data/README.md
CHANGED
data/lib/carbon_pms/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
1
3
|
module CarbonPms
|
2
4
|
class Client
|
3
5
|
include HTTParty
|
@@ -43,7 +45,7 @@ module CarbonPms
|
|
43
45
|
|
44
46
|
# Sends a push notification to the APNS
|
45
47
|
#
|
46
|
-
# @param [Hash] options hash to construct
|
48
|
+
# @param [Hash] options hash to construct a notification
|
47
49
|
# @option options [String] :device_token the device token to receive this push notification
|
48
50
|
# @option options [String] :app the name of the app
|
49
51
|
# @option options [String] :environment the environment this app is running in _(production, development, sandbox)_
|
@@ -56,6 +58,19 @@ module CarbonPms
|
|
56
58
|
return post '/push/apns', query: options
|
57
59
|
end
|
58
60
|
|
61
|
+
# Sends a push notification to GCM
|
62
|
+
#
|
63
|
+
# @param [Hash] options hash to construct a notification
|
64
|
+
# @option options [String] :registration_ids array of registration ids to receive this notification. You can send up to 1000 at once.
|
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 [Hash] :data any custom attributes to send
|
68
|
+
# @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
|
+
# @option options [Integer] :expiry set the time to live of the message. Can be from 0 to 2,419,200 seconds.
|
70
|
+
def gcm_notification(options={})
|
71
|
+
return post '/push/gcm', query: options
|
72
|
+
end
|
73
|
+
|
59
74
|
private
|
60
75
|
|
61
76
|
def post(path, options={})
|
data/lib/carbon_pms/version.rb
CHANGED