Sha256: b70207ffd1a1220378d68f763b7ace4174dcb8833396c59918476167349ece52

Contents?: true

Size: 660 Bytes

Versions: 3

Compression:

Stored size: 660 Bytes

Contents

require 'singleton'
require 'xinge/base'
require 'xinge/ios'
require 'xinge/android'

module Xinge

  class Notification
    include Singleton
    attr_reader :android, :ios
    def initialize
      @android = Xinge::Android.new(Xinge.config[:android_accessId].to_i, Xinge.config[:android_secretKey])
      @ios     = Xinge::Ios.new(Xinge.config[:ios_accessId].to_i, Xinge.config[:ios_secretKey])
    end
    #发送简单消息到所有 android , ios 设备
    def send_simple_to_all(title, content)
      result = []
      [@android, @ios].each do |sender|
        result << sender.pushToAllDevice(title,content)
      end
      result
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xinge-for-ruby-0.1.15 lib/xinge/notification.rb
xinge-for-ruby-0.1.14 lib/xinge/notification.rb
xinge-for-ruby-0.1.13 lib/xinge/notification.rb