Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app_push
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
app_push
Commits
e8db51e8
Commit
e8db51e8
authored
May 23, 2019
by
zmj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改小米推送的设备的次数限制
parent
c473b3f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/services/push/xiaomi.rb
+6
-4
No files found.
app/services/push/xiaomi.rb
View file @
e8db51e8
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment