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
cba6f722
Commit
cba6f722
authored
May 17, 2019
by
zmj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix huawei 推送参数
parent
97818129
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
lib/app_push/huawei.rb
+15
-8
lib/app_push/version.rb
+1
-1
No files found.
lib/app_push/huawei.rb
View file @
cba6f722
...
...
@@ -33,7 +33,7 @@ module AppPush
ver:
'1'
,
appId:
config
[
'app_id'
]
}
url
=
"https://api.push.hicloud.com/pushsend.do?nsp_ctx=
#{
URI
.
escape
(
nsp_ctx
.
to_s
)
}
"
url
=
"https://api.push.hicloud.com/pushsend.do?nsp_ctx=
#{
CGI
::
escape
(
nsp_ctx
.
to_json
)
}
"
AppPush
::
Log
.
info
(
"url:
#{
url
}
"
)
AppPush
::
Log
.
info
(
"body:
#{
body
}
"
)
response
=
HTTParty
.
post
(
url
,
body:
body
,
headers:
headers
,
timeout:
5
)
...
...
@@ -51,13 +51,19 @@ module AppPush
}
}
}
{
access_token:
'access_token'
,
nsp_svc:
'openpush.message.api.send'
,
nsp_ts:
Time
.
now
.
to_i
,
device_token_list:
device_tokens
,
# 单次最多100
payload:
payload
params
=
{
access_token:
CGI
.
escape
(
access_token
)
,
nsp_svc:
CGI
.
escape
(
'openpush.message.api.send'
)
,
nsp_ts:
CGI
.
escape
(
Time
.
now
.
to_i
.
to_s
)
,
device_token_list:
CGI
.
escape
(
device_tokens
.
to_s
),
payload:
CGI
.
escape
(
payload
.
to_json
)
}
params_str
=
''
params
.
each_with_index
do
|
(
key
,
value
),
index
|
params_str
+=
"
#{
key
}
=
#{
value
}
"
params_str
+=
'&'
if
index
+
1
<
params
.
size
end
params_str
end
def
handle_token_res
...
...
@@ -89,4 +95,4 @@ module AppPush
end
end
end
end
end
\ No newline at end of file
lib/app_push/version.rb
View file @
cba6f722
module
AppPush
VERSION
=
"0.1.
2.1
"
VERSION
=
"0.1.
3
"
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