Sha256: 58e789ebd8c441f463cd09b4e32a42471bfc2b830469ed14037bcecf0186e59e

Contents?: true

Size: 651 Bytes

Versions: 14

Compression:

Stored size: 651 Bytes

Contents

require 'active_support/dependencies'

module Agilib
  module PushNotification
  	module Platform
	  	module Ios
	    	extend ActiveSupport::Concern

	    	mattr_accessor :pem
	    	@@pem = nil

	    	mattr_accessor :port
	    	@@port = 2195

	    	def self.send_notification(message, data = {}, device = nil)
	    		certificate = @@pem
	        APNS.pem  = certificate
	        APNS.port = @@port

	        device_token = device.register
	        
	        unless device_token.nil?
	          APNS.send_notification(device_token, :alert => message, :badge => 5, :sound => 'default', :other => data)
	        end
	    	end

	    end
  	end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
agilib-0.1.9 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.8 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.7 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.6 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.5 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.4 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.3 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.2.beta6 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.2.beta5 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.2.beta4 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.2.beta3 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.2.beta2 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.2.beta1 lib/agilib/push_notification/platforms/ios.rb
agilib-0.1.1.beta1 lib/agilib/push_notification/platforms/ios.rb