Sha256: aa963b1be6375a3fd405d77a1a9ea9a3ea601e9d30ebe09617bc5e8145fa090e

Contents?: true

Size: 695 Bytes

Versions: 2

Compression:

Stored size: 695 Bytes

Contents

require 'xinge/base'
module Xinge
  class Android < Base
    def initialize(accessId = nil, secretKey = nil, options = {})
      super
    end
    def pushToSingleDevice(token, title, content, params={}, custom_content={})
      self.push_single_device(token, 1, build_simple_message(title, content, custom_content), params)
    end
    def pushToAllDevice(title, content, params={}, custom_content={})
      self.push_all_device(1, build_simple_message(title, content, custom_content), params)
    end

    protected

    def build_simple_message(title, content, custom_content)
      {
        title: title, content: content, vibrate: 1
      }.merge(custom_content).to_json
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-for-xinge-0.1.4 lib/xinge/android.rb
ruby-for-xinge-0.1.3 lib/xinge/android.rb