From 11da769a9cf0a78c8098382427b9fc4601946eb6 Mon Sep 17 00:00:00 2001 From: taohebin Date: Fri, 8 Mar 2024 16:35:06 +0800 Subject: [PATCH] fix: uts-progressNotification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 把全局的callback放到独立文件中,避免在uniapp1.0中编译byjs后缀的方法 --- uni_modules/uts-progressNotification/changelog.md | 2 ++ uni_modules/uts-progressNotification/package.json | 2 +- .../utssdk/app-android/TransparentActivity.uts | 2 +- .../utssdk/app-android/callbacks.uts | 4 ++++ .../uts-progressNotification/utssdk/app-android/index.uts | 8 ++++---- 5 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 uni_modules/uts-progressNotification/utssdk/app-android/callbacks.uts diff --git a/uni_modules/uts-progressNotification/changelog.md b/uni_modules/uts-progressNotification/changelog.md index d326a91..8f90d3d 100644 --- a/uni_modules/uts-progressNotification/changelog.md +++ b/uni_modules/uts-progressNotification/changelog.md @@ -1,3 +1,5 @@ +## 1.1.0(2024-03-08) +修复uniapp打包报错问题 ## 1.0.9(2024-02-29) 去除代码过时警告 ## 1.0.8(2023-12-21) diff --git a/uni_modules/uts-progressNotification/package.json b/uni_modules/uts-progressNotification/package.json index e5f75a2..d3a6dcc 100644 --- a/uni_modules/uts-progressNotification/package.json +++ b/uni_modules/uts-progressNotification/package.json @@ -1,7 +1,7 @@ { "id": "uts-progressNotification", "displayName": "uts-progressNotification", - "version": "1.0.9", + "version": "1.1.0", "description": "uts-progressNotification", "keywords": [ "uts-progressNotification" diff --git a/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts b/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts index edbf05f..1967899 100644 --- a/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts +++ b/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts @@ -4,7 +4,7 @@ import Build from 'android.os.Build'; import View from 'android.view.View'; import Color from 'android.graphics.Color'; import WindowManager from 'android.view.WindowManager'; -import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './index.uts'; +import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './callbacks.uts'; import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts" diff --git a/uni_modules/uts-progressNotification/utssdk/app-android/callbacks.uts b/uni_modules/uts-progressNotification/utssdk/app-android/callbacks.uts new file mode 100644 index 0000000..2378189 --- /dev/null +++ b/uni_modules/uts-progressNotification/utssdk/app-android/callbacks.uts @@ -0,0 +1,4 @@ + + +export let globalNotificationProgressCallBack : (() => void) | null = () => { } +export let globalNotificationProgressFinishCallBack = () => { } diff --git a/uni_modules/uts-progressNotification/utssdk/app-android/index.uts b/uni_modules/uts-progressNotification/utssdk/app-android/index.uts index 39d14cd..0782f61 100644 --- a/uni_modules/uts-progressNotification/utssdk/app-android/index.uts +++ b/uni_modules/uts-progressNotification/utssdk/app-android/index.uts @@ -8,7 +8,8 @@ import ComponentName from 'android.content.ComponentName'; import PendingIntent from 'android.app.PendingIntent'; import { CreateNotificationProgressOptions, FinishNotificationProgressOptions } from '../interface.uts'; import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts" - + +import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './callbacks.uts'; export { TransparentActivity } from './TransparentActivity.uts'; @@ -26,8 +27,7 @@ let histroyProgress = 0 let isProgress = false -export let globalNotificationProgressCallBack : (() => void) | null = () => { } -export let globalNotificationProgressFinishCallBack = () => { } + export function createNotificationProgress(options : CreateNotificationProgressOptions) : void { const { content, progress, onClick } = options @@ -156,4 +156,4 @@ function getAppName(context : Context) : string { e.printStackTrace() } return appName -} \ No newline at end of file +} -- GitLab