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.

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ApnNotification.



5
6
7
8
9
10
# File 'lib/apns_dispatch/apn_notification.rb', line 5

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

Instance Method Details

#send_notificationObject



12
13
14
# File 'lib/apns_dispatch/apn_notification.rb', line 12

def send_notification
  @connection.write notification_packet
end