Преглед изворни кода

谷歌推送增加channel_id

peng пре 2 година
родитељ
комит
c319741d30
2 измењених фајлова са 2 додато и 4 уклоњено
  1. 1 2
      Service/DevicePushService.py
  2. 1 2
      Service/PushService.py

+ 1 - 2
Service/DevicePushService.py

@@ -483,14 +483,13 @@ class DevicePushService:
                 "received_at": n_time, "sound": "sound.aif", "uid": uid, "zpush": "1", "channel": channel}
         result = push_service.notify_single_device(registration_id=token_val, message_title=msg_title,
                                                    message_body=msg_text, data_message=data,
-                                                   click_action='android.intent.action.VIEW',
                                                    extra_kwargs={
                                                        'default_vibrate_timings': True,
                                                        'default_sound': True,
                                                        'default_light_settings': True
                                                    },
                                                    extra_notification_kwargs={
-                                                       'android_channel_id': 1
+                                                       'click_action': 'android.intent.action.VIEW'
                                                    }
                                                    )
         return result

+ 1 - 2
Service/PushService.py

@@ -163,13 +163,12 @@ class PushObject:
                          }
             result = push_service.notify_single_device(registration_id=token_val, message_title=msg_title,
                                                        message_body=msg_text, data_message=push_data,
-                                                       click_action='android.intent.action.VIEW',
                                                        extra_kwargs={'default_sound': True,
                                                                      'default_vibrate_timings': True,
                                                                      'default_light_settings': True,
                                                                      },
                                                        extra_notification_kwargs={
-                                                           'android_channel_id': 1
+                                                           'click_action': 'android.intent.action.VIEW'
                                                        }
                                                        )
             logger.info('fcm推送结果:{}'.format(result))