lib/xinge/ios.rb in ruby-for-xinge-0.1.0 vs lib/xinge/ios.rb in ruby-for-xinge-0.1.1

- old
+ new

@@ -1,15 +1,18 @@ require 'xinge/base' module Xinge class Ios < Base + + ENV_MAP = {'production' => 1, 'development' => 2} + def initialize(accessId = nil, secretKey = nil, options = {}) super end def pushToSingleDevice(token, title, content, params={}) - self.push_single_device(token, 1, build_simple_message(title, content), {environment: 2}) + self.push_single_device(token, 1, build_simple_message(title, content), {environment: ENV_MAP[Xinge.config[:env]]}) end def pushToAllDevice(title, content, params={}) - self.push_all_device(1, build_simple_message(title, content), {environment: 2}) + self.push_all_device(1, build_simple_message(title, content), {environment: ENV_MAP[Xinge.config[:env]]}) end protected def build_simple_message(title,content)