zhuojiaxuan 1 miesiąc temu
rodzic
commit
6bf7daddaf
1 zmienionych plików z 9 dodań i 9 usunięć
  1. 9 9
      Service/PushService.py

+ 9 - 9
Service/PushService.py

@@ -229,14 +229,6 @@ class PushObject:
                 apns_url = "https://api.sandbox.push.apple.com" if CONFIG_INFO == CONFIG_TEST else "https://api.push.apple.com"
                 url = f"{apns_url}/3/device/{token_val}"
 
-
-                jump_type = CommonService.get_jump_type(event_type)
-                push_data = {
-                    'alert': msg_text, 'msg': '', 'sound': '',
-                    'zpush': '1', 'uid': uid, 'channel': channel,
-                    'received_at': n_time, 'event_time': n_time, 'event_type': event_type,
-                    'nickname': nickname, 'image_url': launch_image, 'jump_type': jump_type
-                }
                 sound = 'call_phone.mp3' if event_type in DATA_PUSH_EVENT_TYPE_LIST else 'default'
 
                 body = {
@@ -249,7 +241,15 @@ class PushObject:
                         "category": "myCategory",
                         "mutable-content": 1
                     },
-                    "custom": push_data
+                    "image_url": launch_image,
+                    "uid": uid,
+                    "channel": channel,
+                    "received_at": n_time,
+                    "event_time": n_time,
+                    "event_type": event_type,
+                    "nickname": nickname,
+                    "zpush": "1",
+                    "jump_type": CommonService.get_jump_type(event_type)
                 }
 
                 headers = {