Module: ApplePush
- Defined in:
- lib/apple-push.rb,
lib/apple-push/version.rb,
lib/apple-push/notification.rb
Defined Under Namespace
Classes: Notification
Constant Summary collapse
- Version =
VERSION = '1.0.0'
Class Attribute Summary collapse
-
.host ⇒ Object
Returns the value of attribute host.
-
.port ⇒ Object
Returns the value of attribute port.
Class Method Summary collapse
Class Attribute Details
.host ⇒ Object
Returns the value of attribute host.
15 16 17 |
# File 'lib/apple-push.rb', line 15 def host @host end |
.port ⇒ Object
Returns the value of attribute port.
16 17 18 |
# File 'lib/apple-push.rb', line 16 def port @port end |
Class Method Details
.send_notification(apns_pem, apns_token, message = {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/apple-push.rb', line 19 def self.send_notification(apns_pem, apns_token, = {}) connection(apns_pem) do |ssl| notification = ApplePush::Notification.new(apns_token, ) puts "#{Time.now} [#{host}:#{port}] Device: #{notification.device_token.unpack('H*')} sending #{.inspect}" ssl.write(notification.to_s) end end |