Class: IOSPN::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ios_push_notifications/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ios_push_notifications/configuration.rb', line 5

def initialize
  @feedback = {}
  @notification = {}
  @notification = {:passphrase => '', :port => 2195}
  @feedback = {:passphrase => @notification[:passphrase], :port => 2196}
  if Rails.env.production?
    @notification[:host] = "gateway.push.apple.com"
    @notification[:cert] = File.join(Rails.root, 'config', 'apple_push_notification_production.pem') if Rails.root
    @feedback[:host] = "feedback.push.apple.com"
    @feedback[:cert] = @notification[:cert]
  else
    @notification[:host] = "gateway.sandbox.push.apple.com"
    @notification[:cert] = File.join(Rails.root, 'config', 'apple_push_notification_development.pem') if Rails.root
    @feedback[:host] = "feedback.sandbox.push.apple.com"
    @feedback[:cert] = @notification[:cert]
  end
end

Instance Attribute Details

#feedbackObject

Returns the value of attribute feedback.



3
4
5
# File 'lib/ios_push_notifications/configuration.rb', line 3

def feedback
  @feedback
end

#notificationObject

Returns the value of attribute notification.



3
4
5
# File 'lib/ios_push_notifications/configuration.rb', line 3

def notification
  @notification
end