lib/rongcloud/service/message.rb in rongcloud-0.1.5 vs lib/rongcloud/service/message.rb in rongcloud-0.1.6
- old
+ new
@@ -2,16 +2,20 @@
module Service
class Message < Rongcloud::Service::Model
attr_accessor :from_user_id
attr_accessor :to_user_id
attr_accessor :object_name #消息类型
+ attr_accessor :push_data
+ attr_accessor :push_content
#发送单聊消息
def private_publish(rc_msg)
post = {uri: Rongcloud::Service::API_URI[:MSG_PRV_PUBLISH],
params: optional_params({fromUserId: self.from_user_id, toUserId: self.to_user_id,
objectName: self.object_name,
+ pushData: self.push_data,
+ pushContent: self.push_content,
content: rc_msg.json_content})
}
res = Rongcloud::Service.req_post(post)
res[:code]==200
end
@@ -19,9 +23,11 @@
#发送系统消息
def system_public(rc_msg)
post = {uri: Rongcloud::Service::API_URI[:MSG_SYSTEM_PUBLISH],
params: optional_params({fromUserId: self.from_user_id, toUserId: self.to_user_id,
objectName: self.object_name,
+ pushData: self.push_data,
+ pushContent: self.push_content,
content: rc_msg.json_content})
}
res = Rongcloud::Service.req_post(post)
res[:code]==200
end
\ No newline at end of file