Prechádzať zdrojové kódy

谷歌推送增加通道

peng 1 rok pred
rodič
commit
064e2a2750
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      Service/PushService.py

+ 3 - 0
Service/PushService.py

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