ソースを参照

苹果一键通话推送改为自定义铃声

locky 1 年間 前
コミット
9e0a5170ce
1 ファイル変更2 行追加1 行削除
  1. 2 1
      Service/PushService.py

+ 2 - 1
Service/PushService.py

@@ -130,7 +130,8 @@ class PushObject:
                          'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
                          'image_url': launch_image
                          }
-            payload = apns2.Payload(alert=alert, custom=push_data, sound='default', category='myCategory',
+            sound = 'call_phone.mp3' if event_type in [606, 607] else 'default'
+            payload = apns2.Payload(alert=alert, custom=push_data, sound=sound, category='myCategory',
                                     mutable_content=True)
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=app_bundle_id)