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
0a682d08
Commit
0a682d08
authored
Dec 08, 2016
by
fendouai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a new example
parent
846c1534
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
conf.py
examples/push_examples/conf.py
+1
-1
example_alias.py
examples/push_examples/example_alias.py
+24
-0
example_audience.py
examples/push_examples/example_audience.py
+3
-0
No files found.
examples/push_examples/conf.py
View file @
0a682d08
# please put your app_key and master_secret here
app_key
=
u'6be9204c30b9473e87bad4dc'
master_secret
=
u'
9349ad7c90292a603c512e92
'
master_secret
=
u'
a564b268ba23631a8a34e687
'
examples/push_examples/example_alias.py
0 → 100644
View file @
0a682d08
import
jpush
as
jpush
from
conf
import
app_key
,
master_secret
_jpush
=
jpush
.
JPush
(
app_key
,
master_secret
)
_jpush
.
set_logging
(
"DEBUG"
)
push
=
_jpush
.
create_push
()
alias
=
[
"alias1"
,
"alias2"
]
alias1
=
{
"alias"
:
alias
}
print
alias1
push
.
audience
=
jpush
.
audience
(
jpush
.
tag
(
"tag1"
,
"tag2"
),
alias1
)
'''
push.audience = jpush.audience(
jpush.tag("tag1", "tag2"),
jpush.alias("alias1", "alias2")
)
'''
push
.
notification
=
jpush
.
notification
(
alert
=
"Hello world with audience!"
)
push
.
platform
=
jpush
.
all_
print
(
push
.
payload
)
push
.
send
()
\ No newline at end of file
examples/push_examples/example_audience.py
View file @
0a682d08
...
...
@@ -3,10 +3,13 @@ from conf import app_key, master_secret
_jpush
=
jpush
.
JPush
(
app_key
,
master_secret
)
_jpush
.
set_logging
(
"DEBUG"
)
push
=
_jpush
.
create_push
()
push
.
audience
=
jpush
.
audience
(
jpush
.
tag
(
"tag1"
,
"tag2"
),
jpush
.
alias
(
"alias1"
,
"alias2"
)
)
push
.
notification
=
jpush
.
notification
(
alert
=
"Hello world with audience!"
)
push
.
platform
=
jpush
.
all_
print
(
push
.
payload
)
...
...
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