Sha256: 2d219431679c18986bc0eb9dc2e68d5367908657125aa094666dd501162b7100

Contents?: true

Size: 978 Bytes

Versions: 12

Compression:

Stored size: 978 Bytes

Contents

class ApnsChannel

  class << self

  	def default_options
  	  {
  	    description: "Push Notifications"
  	  }
  	end

    def deliver(notification, options={})
      NotifyUser::Apns.push_notification(notification)

      #check for the existence of development api keys and resend for development
      if !ENV['DEV_UA_APPLICATION_KEY'].nil? && !ENV['DEV_UA_APPLICATION_SECRET'].nil? && !ENV['DEV_UA_MASTER_SECRET'].nil?

        Urbanairship.application_key = ENV['DEV_UA_APPLICATION_KEY']
        Urbanairship.application_secret = ENV['DEV_UA_APPLICATION_SECRET']
        Urbanairship.master_secret = ENV['DEV_UA_MASTER_SECRET']

        NotifyUser::Apns.push_notification(notification)

        #sets the api keys back to their original state

        Urbanairship.application_key = ENV['UA_APPLICATION_KEY']
        Urbanairship.application_secret = ENV['UA_APPLICATION_SECRET']
        Urbanairship.master_secret = ENV['UA_MASTER_SECRET']
      end
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
notify_user-0.0.28 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.27 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.26 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.25 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.24 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.23 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.22 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.20 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.19 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.18 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.16 lib/notify_user/channels/apns/apns_channel.rb
notify_user-0.0.15 lib/notify_user/channels/apns/apns_channel.rb