Browse Source

debug:极光推送

chenjunkai 6 years ago
parent
commit
2684013962
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Controller/Test.py

+ 4 - 4
Controller/Test.py

@@ -28,9 +28,9 @@ class Test(View):
 
     def get(self, request, *args, **kwargs):
         response = ResponseObject()
-        devToken = request.GET.get('devToken', None)
-        app_key = request.GET.get('app_key', None)
-        master_secret = request.GET.get('master_secret', None)
+        devToken = request.GET.get('devToken', '')
+        app_key = request.GET.get('app_key', '')
+        master_secret = request.GET.get('master_secret', '')
         import jpush as jpush
 
         # 此处换成各自的app_key和master_secret
@@ -39,7 +39,7 @@ class Test(View):
         # if you set the logging level to "DEBUG",it will show the debug logging.
         _jpush.set_logging("DEBUG")
         # push.audience = jpush.all_
-        push.audience = jpush.registration_id(devToken)
+        push.audience = jpush.registration_id([devToken])
         push.notification = jpush.notification(alert="hello python jpush api")
         push.platform = jpush.all_
         try: