Class: Pwush::Client
- Inherits:
-
Object
- Object
- Pwush::Client
- Defined in:
- lib/pwush/client.rb
Instance Method Summary collapse
- #application_open(hwid) ⇒ Object
-
#applications ⇒ Object
enterprise api.
- #create_message(*messages) ⇒ Object (also: #push)
- #create_test_device(params) ⇒ Object
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #list_test_devices ⇒ Object
- #message_delivery_event(hwid, hash_tag = nil) ⇒ Object
- #message_details(message) ⇒ Object
-
#message_stats(message) ⇒ Object
enterprise api.
-
#preset(preset_code) ⇒ Object
enterprise api.
- #push_stat(hwid, hash_tag = nil) ⇒ Object
-
#register_device(params) ⇒ Object
DEVICE API.
-
#results(request_id) ⇒ Object
enterprise api.
- #set_badge(hwid, badge) ⇒ Object
- #set_purchase(hwid, params = {}) ⇒ Object
- #unregister_device(hwid) ⇒ Object
Constructor Details
Instance Method Details
#application_open(hwid) ⇒ Object
60 61 62 |
# File 'lib/pwush/client.rb', line 60 def application_open(hwid) post(:applicationOpen, hwid: hwid) end |
#applications ⇒ Object
enterprise api
29 30 31 |
# File 'lib/pwush/client.rb', line 29 def applications post(:getApplications) end |
#create_message(*messages) ⇒ Object Also known as: push
9 10 11 |
# File 'lib/pwush/client.rb', line 9 def (*) post(:createMessage, notifications: .flatten) end |
#create_test_device(params) ⇒ Object
48 49 50 |
# File 'lib/pwush/client.rb', line 48 def create_test_device(params) post(:createTestDevice, params) end |
#list_test_devices ⇒ Object
52 53 54 |
# File 'lib/pwush/client.rb', line 52 def list_test_devices post(:listTestDevices) end |
#message_delivery_event(hwid, hash_tag = nil) ⇒ Object
68 69 70 |
# File 'lib/pwush/client.rb', line 68 def (hwid, hash_tag = nil) post(:messageDeliveryEvent, hwid: hwid, hash: hash_tag) end |
#message_details(message) ⇒ Object
14 15 16 |
# File 'lib/pwush/client.rb', line 14 def () post(:getMessageDetails, message: ) end |
#message_stats(message) ⇒ Object
enterprise api
19 20 21 |
# File 'lib/pwush/client.rb', line 19 def () post(:getMsgStats, message: ) end |
#preset(preset_code) ⇒ Object
enterprise api
34 35 36 |
# File 'lib/pwush/client.rb', line 34 def preset(preset_code) post(:getPreset, preset_code: preset_code) end |
#push_stat(hwid, hash_tag = nil) ⇒ Object
64 65 66 |
# File 'lib/pwush/client.rb', line 64 def push_stat(hwid, hash_tag = nil) post(:pushStat, hwid: hwid, hash: hash_tag) end |
#register_device(params) ⇒ Object
DEVICE API
40 41 42 |
# File 'lib/pwush/client.rb', line 40 def register_device(params) post(:registerDevice, params) end |
#results(request_id) ⇒ Object
enterprise api
24 25 26 |
# File 'lib/pwush/client.rb', line 24 def results(request_id) post(:getResults, request_id: request_id) end |
#set_badge(hwid, badge) ⇒ Object
56 57 58 |
# File 'lib/pwush/client.rb', line 56 def set_badge(hwid, badge) post(:setBadge, hwid: hwid, badge: badge) end |
#set_purchase(hwid, params = {}) ⇒ Object
72 73 74 |
# File 'lib/pwush/client.rb', line 72 def set_purchase(hwid, params = {}) post(:setPurchase, params.merge(hwid: hwid)) end |
#unregister_device(hwid) ⇒ Object
44 45 46 |
# File 'lib/pwush/client.rb', line 44 def unregister_device(hwid) post(:unregisterDevice, hwid: hwid) end |