Commit 644fe185 authored by Helperhaps's avatar Helperhaps

add zone examples

parent ca179c93
......@@ -12,6 +12,7 @@ from . import report_example
from . import schedule_example
from . import group_push_example
from . import admin_example
from . import zone_example
__all__ = [
device_example,
......@@ -19,5 +20,6 @@ __all__ = [
report_example,
schedule_example,
group_push_example,
admin_example
admin_example,
zone_example,
]
from . import jpush, app_key, master_secret
def default():
_jpush = jpush.JPush(app_key, master_secret)
_jpush.set_logging("DEBUG")
push = _jpush.create_push()
push.audience = jpush.all_
push.notification = jpush.notification(alert="!hello python jpush api")
push.platform = jpush.all_
try:
response=push.send()
except common.Unauthorized:
raise common.Unauthorized("Unauthorized")
except common.APIConnectionException:
raise common.APIConnectionException("conn")
except common.JPushFailure:
print ("JPushFailure")
except:
print ("Exception")
def bj():
_jpush = jpush.JPush(app_key, master_secret, zone = 'bj')
_jpush.set_logging("DEBUG")
push = _jpush.create_push()
push.audience = jpush.all_
push.notification = jpush.notification(alert="!hello python jpush api")
push.platform = jpush.all_
try:
response=push.send()
except common.Unauthorized:
raise common.Unauthorized("Unauthorized")
except common.APIConnectionException:
raise common.APIConnectionException("conn")
except common.JPushFailure:
print ("JPushFailure")
except:
print ("Exception")
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