Commit 0a682d08 authored by fendouai's avatar fendouai

add a new example

parent 846c1534
# please put your app_key and master_secret here
app_key = u'6be9204c30b9473e87bad4dc'
master_secret = u'9349ad7c90292a603c512e92'
master_secret = u'a564b268ba23631a8a34e687'
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
......@@ -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)
......
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