|
@@ -246,7 +246,7 @@ class NotificationView(View):
|
|
|
if not have_dkey:
|
|
|
logger.info('准备推送:{}, {}'.format(uid, request_dict))
|
|
|
# if (is_st == 1 or is_st == 3) and (push_type == 0 or push_type == 1):
|
|
|
- push_thread = threading.Thread(target=self.push_thread_test, args=(push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text))
|
|
|
+ push_thread = threading.Thread(target=self.push_thread_test, args=(push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text, channel))
|
|
|
push_thread.start()
|
|
|
if push_type == 0: # ios apns
|
|
|
do_apns_code = self.do_apns(**kwag_args)
|
|
@@ -371,7 +371,7 @@ class NotificationView(View):
|
|
|
elif push_type == 1:
|
|
|
GatewayPushService.android_fcm_push(uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, image_url)
|
|
|
|
|
|
- def push_thread_test(self, push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text):
|
|
|
+ def push_thread_test(self, push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text, channel):
|
|
|
logger = logging.getLogger('info')
|
|
|
logger.info('推送图片测试:{} {} {} {} {} {} {} {}'.format(push_type, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text))
|
|
|
time.sleep(3)
|
|
@@ -381,9 +381,9 @@ class NotificationView(View):
|
|
|
image_url = aws_s3_client.generate_presigned_url('get_object', Params={'Bucket': bucket, 'Key': thumbspng}, ExpiresIn=86400)
|
|
|
logger.info('推送图片url:{}'.format(image_url))
|
|
|
if push_type == 0:
|
|
|
- GatewayPushService.ios_apns_push(uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, image_url)
|
|
|
+ GatewayPushService.ios_apns_push(uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, uid, channel, image_url)
|
|
|
elif push_type == 1:
|
|
|
- GatewayPushService.android_fcm_push(uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, image_url)
|
|
|
+ GatewayPushService.android_fcm_push(uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, uid, channel, image_url)
|
|
|
except Exception as e:
|
|
|
logger.info('推送图片测试异常:{}'.format(e))
|
|
|
|