From 3e3fbf3370b7a97e5b7b6ca6ec15740d24809058 Mon Sep 17 00:00:00 2001 From: shijie Date: Thu, 2 Jan 2025 19:00:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9Aflutter=5Fdownloader=E4=B8=8B=E8=BD=BD=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=AE=BE=E7=BD=AE=E4=B8=8D=E5=9C=A8=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=A0=8F=E6=98=BE=E7=A4=BA=E4=B8=8D=E7=94=9F=E6=95=88=EF=BC=8C?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E8=BF=98=E6=98=AF=E4=BC=9A=E5=9C=A8=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=A0=8F=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shijie --- ohos/src/main/ets/components/FlutterDownloaderPlugin.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets b/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets index 7c09bf9..f950d09 100644 --- a/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets +++ b/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets @@ -326,6 +326,10 @@ export class FlutterDownloaderPlugin implements FlutterPlugin, MethodCallHandler const filename: string = call.argument('file_name') ?? url.substring(url.lastIndexOf("/") + 1, url.length); const headers = this.requireArgument(call, 'headers'); const showNotification = this.requireArgument(call, 'show_notification'); + // 如果showNotification为false则提示:鸿蒙不支持将showNotification设置为false。(鸿蒙官方暂不支持该属性) + if(!showNotification){ + result.error("8", "ohos does not support setting showNotification to false.", "ohos does not support setting showNotification to false."); + } const openFileFromNotification = this.requireArgument(call, 'open_file_from_notification'); const allowCellular = this.requireArgument(call, 'allow_cellular'); const taskId = -- Gitee From 5364ff7d6f6e29d98dabbaa23a905ad60068bf07 Mon Sep 17 00:00:00 2001 From: shijie Date: Fri, 3 Jan 2025 13:52:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shijie --- ohos/src/main/ets/components/FlutterDownloaderPlugin.ets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets b/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets index f950d09..19f0c70 100644 --- a/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets +++ b/ohos/src/main/ets/components/FlutterDownloaderPlugin.ets @@ -327,8 +327,9 @@ export class FlutterDownloaderPlugin implements FlutterPlugin, MethodCallHandler const headers = this.requireArgument(call, 'headers'); const showNotification = this.requireArgument(call, 'show_notification'); // 如果showNotification为false则提示:鸿蒙不支持将showNotification设置为false。(鸿蒙官方暂不支持该属性) - if(!showNotification){ + if (!showNotification) { result.error("8", "ohos does not support setting showNotification to false.", "ohos does not support setting showNotification to false."); + return; } const openFileFromNotification = this.requireArgument(call, 'open_file_from_notification'); const allowCellular = this.requireArgument(call, 'allow_cellular'); -- Gitee