浏览代码

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

peng 1 年之前
父节点
当前提交
7ae04fbc39
共有 1 个文件被更改,包括 3 次插入1 次删除
  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,
                                                                      },