| 1234567891011121314151617181920212223242526272829303132333435363738394041 | 
							- #!/usr/bin/env python3  
 
- # -*- coding: utf-8 -*-  
 
- """
 
- @Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
 
- @AUTHOR: ASJRD018
 
- @NAME: AnsjerFormal
 
- @software: PyCharm
 
- @DATE: 2019/12/14 16:25
 
- @Version: python3.6
 
- @MODIFY DECORD:ansjer dev
 
- @file: push_debug.py
 
- @Contact: chanjunkai@163.com
 
- """
 
- import time
 
- app_key = "d9924f56d3cc7c6017965130"
 
- master_secret = "869d832d126a232f158b5987"
 
- devToken = "13065ffa4e65a3d5c40"
 
- import jpush as jpush
 
- # 此处换成各自的app_key和master_secret
 
- _jpush = jpush.JPush(app_key, master_secret)
 
- push = _jpush.create_push()
 
- # if you set the logging level to "DEBUG",it will show the debug logging.
 
- _jpush.set_logging("DEBUG")
 
- # push.audience = jpush.all_
 
- n_time = int(time.time())
 
- event_type = 51
 
- push.audience = jpush.registration_id(devToken)
 
- push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
 
-              "received_at": n_time, "sound": "sound.aif", "uid": 'xoxoxoxoxoxoxoxoxoxo', "zpush": "1"}
 
- android = jpush.android(alert="Hello, Android msg", priority=1, style=1, alert_type=1, big_text='ssssssssssssssssss',
 
-                         extras=push_data, title='fffff')
 
- push.notification = jpush.notification(android=android)
 
- push.platform = jpush.all_
 
- push.send()
 
 
  |