Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jpush-api-python-client
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
jpush-api-python-client
Commits
b0b556dd
Commit
b0b556dd
authored
Feb 17, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add registration id push api;
parent
07c0f3da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
push_api.py
examples/push_api.py
+8
-0
push.py
jpush/push.py
+29
-0
No files found.
examples/push_api.py
View file @
b0b556dd
...
@@ -34,3 +34,11 @@ jpush_client.send_notification_by_appkey(app_key, sendno, 'des',
...
@@ -34,3 +34,11 @@ jpush_client.send_notification_by_appkey(app_key, sendno, 'des',
jpush_client
.
send_custom_msg_by_appkey
(
app_key
,
sendno
,
'des'
,
jpush_client
.
send_custom_msg_by_appkey
(
app_key
,
sendno
,
'des'
,
'appkey msg title'
,
'appkey msg title'
,
'appkey msg content'
,
'android'
)
'appkey msg content'
,
'android'
)
# Send message by registration_id
jpush_client
.
send_notification_by_registrationid
(
'regidapi'
,
app_key
,
sendno
,
'des'
,
'registration id notify title'
,
'registration id notify content'
,
'android'
)
jpush_client
.
send_custom_msg_by_registrationid
(
'regidapi'
,
app_key
,
sendno
,
'des'
,
'registration_id msg title'
,
'registration_id msg content'
,
'android'
)
jpush/push.py
View file @
b0b556dd
...
@@ -160,3 +160,32 @@ class JPushClient:
...
@@ -160,3 +160,32 @@ class JPushClient:
receiver_value
)
receiver_value
)
params
=
self
.
_gen_params
(
locals
())
params
=
self
.
_gen_params
(
locals
())
self
.
_send_msg
(
params
)
self
.
_send_msg
(
params
)
def
send_notification_by_registrationid
(
self
,
registrationid
,
app_key
,
sendno
,
senddes
,
msgtitle
,
msg_content
,
platform
,
extras
=
{}):
'''Send notification by registraion id'''
receiver_type
=
5
msg_type
=
1
msg_content
=
self
.
_gen_content
(
msgtitle
,
msg_content
,
msg_type
,
extras
)
receiver_value
=
tag
verification_code
=
self
.
_gen_verification_code
(
sendno
,
receiver_type
,
receiver_value
)
params
=
self
.
_gen_params
(
locals
())
self
.
_send_msg
(
params
)
def
send_custom_msg_by_registrationid
(
self
,
registrationid
,
app_key
,
sendno
,
senddes
,
msgtitle
,
msg_content
,
platform
,
extras
=
{}):
'''Send custom message by registration id'''
receiver_type
=
5
msg_type
=
2
msg_content
=
self
.
_gen_content
(
msgtitle
,
msg_content
,
msg_type
,
extras
)
receiver_value
=
tag
verification_code
=
self
.
_gen_verification_code
(
sendno
,
receiver_type
,
receiver_value
)
params
=
self
.
_gen_params
(
locals
())
self
.
_send_msg
(
params
)
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