class IGeTui::BaseTemplate
Attributes
push_info[RW]
transmission_content[RW]
transmission_type[RW]
Public Class Methods
new()
click to toggle source
# File lib/igetui/template/base_template.rb, line 5 def initialize @transmission_type = 0 @transmission_content = '' end
Public Instance Methods
get_action_chain()
click to toggle source
# File lib/igetui/template/base_template.rb, line 23 def get_action_chain raise NotImplementedError, 'Must be implemented by subtypes.' end
get_client_data(pusher)
click to toggle source
# File lib/igetui/template/base_template.rb, line 31 def get_client_data(pusher) string = self.get_transparent(pusher).serialize_to_string Base64.strict_encode64 string end
get_push_info()
click to toggle source
# File lib/igetui/template/base_template.rb, line 36 def get_push_info @push_info || init_push_info end
get_push_type()
click to toggle source
# File lib/igetui/template/base_template.rb, line 27 def get_push_type raise NotImplementedError, 'Must be implemented by subtypes.' end
get_transparent(pusher)
click to toggle source
# File lib/igetui/template/base_template.rb, line 10 def get_transparent(pusher) transparent = GtReq::Transparent.new transparent.id = '' transparent.messageId = '' transparent.taskId = '' transparent.action = 'pushmessage' transparent.actionChain = get_action_chain transparent.pushInfo = get_push_info transparent.appId = pusher.app_id transparent.appKey = pusher.app_key transparent end
set_push_info(action_loc_key, badge, message, sound, options = {})
click to toggle source
NOTE: iOS Pusher
need the top four fields of 'push_info' are required. options can be includes [:payload, :loc_key, :loc_args, :launch_image] docs.igetui.com/pages/viewpage.action?pageId=590588
# File lib/igetui/template/base_template.rb, line 44 def set_push_info(action_loc_key, badge, message, sound, options = {}) init_push_info @push_info.actionLocKey = action_loc_key @push_info.badge = badge.to_s @push_info.message = message @push_info.sound = sound @push_info.payload = options[:payload] @push_info.locKey = options[:loc_key] @push_info.locArgs = options[:loc_args] @push_info.launchImage = options[:launch_image] # validate method need refactoring. # Validate.new.validate(args) end
Private Instance Methods
init_push_info()
click to toggle source
# File lib/igetui/template/base_template.rb, line 60 def init_push_info @push_info = GtReq::PushInfo.new @push_info.message = '' @push_info.actionKey = '' @push_info.sound = '' @push_info.badge = '-1' @push_info end