Class: ApnsDispatch::ApnNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/apns_dispatch/apn_notification.rb

Overview

Creates a packaged notification for the APNs. Based on code from github.com/jpoz/APNS.

Constant Summary collapse

COMMAND =

Constants

0

Instance Method Summary collapse

Constructor Details

#initialize(connection, token, message, options = {}) ⇒ ApnNotification

Returns a new instance of ApnNotification.



8
9
10
11
12
13
# File 'lib/apns_dispatch/apn_notification.rb', line 8

def initialize(connection, token, message, options = {})
  @connection = connection
  @token = token
  @message = message
  @options = options
end

Instance Method Details

#send_notificationObject



15
16
17
# File 'lib/apns_dispatch/apn_notification.rb', line 15

def send_notification
  @connection.write notification_packet
end