lib/xinge/android.rb in ruby-for-xinge-0.1.2 vs lib/xinge/android.rb in ruby-for-xinge-0.1.3
- old
+ new
@@ -2,21 +2,21 @@
module Xinge
class Android < Base
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), params)
+ 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={})
- self.push_all_device(1, build_simple_message(title, content), params)
+ 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)
+ def build_simple_message(title, content, custom_content)
{
title: title, content: content, vibrate: 1
- }.to_json
+ }.merge(custom_content).to_json
end
end
end