Commit e8db51e8 by zmj

修改小米推送的设备的次数限制

parent c473b3f4
module Push
module Xiaomi
PUSH_URL = 'https://api.xmpush.xiaomi.com/v3/message/regid'.freeze
PUSH_DEVICE_MAX = 1000
class << self
# 4a7d376b47c847634571a86b37e93272 测试使用的registration_id
def push(registration_id, payload)
registration_id = registration_id.join(',')
post(message(payload, registration_id))
def push(registration_ids, payload)
registration_ids.each_slice(PUSH_DEVICE_MAX) do |registration_ids_array|
registration_id = registration_ids_array.join(',')
post(message(payload, registration_id))
end
rescue StandardError => err
Push::Log.error(err)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment