Przeglądaj źródła

谷歌推送一键通话配置铃声

peng 1 rok temu
rodzic
commit
7ae04fbc39
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      Service/PushService.py

+ 3 - 1
Service/PushService.py

@@ -168,12 +168,14 @@ class PushObject:
                 push_data['content_available'] = True
                 push_data['direct_boot_ok'] = True
                 sound = 'android.resource://com.ansjer.zccloud_a/raw/phone_call'
+                default_sound = False
             else:
                 sound = None  # 其他事件类型默认铃声
+                default_sound = True
             result = push_service.notify_single_device(registration_id=token_val, message_title=msg_title,
                                                        message_body=msg_text, data_message=push_data, sound=sound,
                                                        click_action='android.intent.action.VIEW',
-                                                       extra_kwargs={'default_sound': True,
+                                                       extra_kwargs={'default_sound': default_sound,
                                                                      'default_vibrate_timings': True,
                                                                      'default_light_settings': True,
                                                                      },