diff --git a/uni_modules/uni-progress-notification/utssdk/interface.uts b/uni_modules/uni-progress-notification/utssdk/interface.uts deleted file mode 100644 index 74841bffdb1b8b2fc5c73145f439bf44560ed768..0000000000000000000000000000000000000000 --- a/uni_modules/uni-progress-notification/utssdk/interface.uts +++ /dev/null @@ -1,145 +0,0 @@ -export type uni = { - /** - * createNotificationProgress() - * @description - * 创建通知栏下载进度消息 - * @param {CreateNotificationProgressOptions} - * @return {void} - * @uniPlatform { - * "app": { - * "android": { - * "osVer": "4.4", - * "uniVer": "3.9+", - * "unixVer": "3.9+" - * }, - * "ios": { - * "osVer": "x", - * "uniVer": "x", - * "unixVer": "x" - * } - * } - * } - * @example - ```typescript - uni.createNotificationProgress({ - title: "正在下载升级包", - content: "进度 50%", - progress: 50, - onClick:()=>{ - console.log("正在下载"); - } - } - ``` - */ - createNotificationProgress : (options : CreateNotificationProgressOptions) => void, - /** - * finishNotificationProgress() - * @description - * 通知栏显示下载完成,并且传入点击通知栏消息的回调。 - * @param {FinishNotificationProgressOptions} - * @return {void} - * @uniPlatform { - * "app": { - * "android": { - * "osVer": "4.4", - * "uniVer": "3.9+", - * "unixVer": "3.9+" - * }, - * "ios": { - * "osVer": "x", - * "uniVer": "x", - * "unixVer": "x" - * } - * } - * } - * @example - ```typescript - uni.finishNotificationProgress({ - title: "安装升级包", - content: "下载完成。", - onClick: () => { - uni.installApk({ - filePath: e.tempFilePath, - complete(res) { - console.log(res); - } - }) - } - } - ``` - */ - finishNotificationProgress : (options: FinishNotificationProgressOptions) => void, - /** - * cancelNotificationProgress() - * @description - * 取消通知消息显示 - * @param {void} - * @return {void} - * @uniPlatform { - * "app": { - * "android": { - * "osVer": "4.4", - * "uniVer": "3.9+", - * "unixVer": "3.9+" - * }, - * "ios": { - * "osVer": "x", - * "uniVer": "x", - * "unixVer": "x" - * } - * } - * } - * @example - ```typescript - uni.cancelNotificationProgress() - ``` - */ - cancelNotificationProgress : () => void -} - -export type CreateNotificationProgressOptions = { - /** - * 通知标题 - * @defaultValue 应用名称 - */ - title ?: string | null - /** - * 通知内容 - */ - content : string, - /** - * 进度 - */ - progress : number, - /** - * 点击通知消息回调 - * @defaultValue null - */ - onClick? : (() => void) | null -} - - -export type FinishNotificationProgressOptions = { - /** - * 通知标题 - * @defaultValue 应用名称 - */ - title ?: string | null - /** - * 通知内容 - */ - content : string, - /** - * 点击通知消息回调 - */ - onClick : () => void -} - - -export type CreateNotificationProgress = (options : CreateNotificationProgressOptions) => void; - - -export type CancelNotificationProgress = () => void; - - -export type FinishNotificationProgress = (options: FinishNotificationProgressOptions) => void \ No newline at end of file diff --git a/uni_modules/uni-progress-notification/changelog.md b/uni_modules/uts-progressNotification/changelog.md similarity index 66% rename from uni_modules/uni-progress-notification/changelog.md rename to uni_modules/uts-progressNotification/changelog.md index 1066eb5a7cdddcc5d0ff22cf7ba5a83230255e4f..332470475bb5475b7d3b24b633c91917f4dce414 100644 --- a/uni_modules/uni-progress-notification/changelog.md +++ b/uni_modules/uts-progressNotification/changelog.md @@ -1,3 +1,10 @@ +## 1.0.7(2023-12-11) +去除无用代码 +## 1.0.6(2023-12-11) +修改文档 +## 1.0.5(2023-12-11) +1.修改插件名称 +2.修改插件引入方式为import导入 ## 1.0.4(2023-11-30) 1. createNotificationProgress增加`onClick`回调 2.修复在小米部分系统上,通知消息会归类于不重要通知的bug diff --git a/uni_modules/uni-progress-notification/package.json b/uni_modules/uts-progressNotification/package.json similarity index 68% rename from uni_modules/uni-progress-notification/package.json rename to uni_modules/uts-progressNotification/package.json index e4bae82b995698adfd14faa7699a2cba3d57304b..09e670999813e2e6271cbfd74dfbcbd43fe344a5 100644 --- a/uni_modules/uni-progress-notification/package.json +++ b/uni_modules/uts-progressNotification/package.json @@ -1,10 +1,10 @@ { - "id": "uni-progress-notification", - "displayName": "uni-progress-notification", - "version": "1.0.4", - "description": "uni-progress-notification", + "id": "uts-progressNotification", + "displayName": "uts-progressNotification", + "version": "1.0.7", + "description": "uts-progressNotification", "keywords": [ - "uni-progress-notification" + "uts-progressNotification" ], "repository": "", "engines": { @@ -32,34 +32,6 @@ }, "uni_modules": { "dependencies": [], - "uni-ext-api": { - "uni": { - "createNotificationProgress": { - "name": "createNotificationProgress", - "app": { - "js": true, - "kotlin": true, - "swift": false - } - }, - "finishNotificationProgress": { - "name": "finishNotificationProgress", - "app": { - "js": true, - "kotlin": true, - "swift": false - } - }, - "cancelNotificationProgress": { - "name": "cancelNotificationProgress", - "app": { - "js": true, - "kotlin": true, - "swift": false - } - } - } - }, "encrypt": [], "platforms": { "cloud": { @@ -108,4 +80,4 @@ } } } -} \ No newline at end of file +} diff --git a/uni_modules/uni-progress-notification/readme.md b/uni_modules/uts-progressNotification/readme.md similarity index 77% rename from uni_modules/uni-progress-notification/readme.md rename to uni_modules/uts-progressNotification/readme.md index 161bf996ede87881ec1aed37e35dc531e43160db..87d85766d7694c927555da282bc1bef7d6d3a7d3 100644 --- a/uni_modules/uni-progress-notification/readme.md +++ b/uni_modules/uts-progressNotification/readme.md @@ -1,12 +1,16 @@ -# uni-download-notification +# uts-progressNotification -## 使用说明 +## 使用说明 Android平台创建显示进度的通知栏消息 **注意: 需要自定义基座,否则点击通知栏消息不会拉起应用** -### uni.createNotificationProgress(options : CreateNotificationProgressOptions) : void, +### 导入 + +需要import导入插件 + +### createNotificationProgress(options : CreateNotificationProgressOptions) : void, 创建显示进度的通知栏消息 @@ -35,7 +39,7 @@ export type CreateNotificationProgressOptions = { } ``` -### uni.finishNotificationProgress(options: FinishNotificationProgressOptions) : void +### finishNotificationProgress(options: FinishNotificationProgressOptions) : void 完成时调用的API,比如下载完成后需要显示下载完成并隐藏进度时调用。 diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/AndroidManifest.xml b/uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml similarity index 77% rename from uni_modules/uni-progress-notification/utssdk/app-android/AndroidManifest.xml rename to uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml index 4d679e4894406a88b092c10beef428ff0ae2e221..93749e96d581dd4446cf670d9406ba4c01291021 100644 --- a/uni_modules/uni-progress-notification/utssdk/app-android/AndroidManifest.xml +++ b/uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml @@ -1,11 +1,11 @@ + package="uts.sdk.modules.utsProgressNotification"> - - \ No newline at end of file + diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/TransparentActivity.uts b/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts similarity index 97% rename from uni_modules/uni-progress-notification/utssdk/app-android/TransparentActivity.uts rename to uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts index 0368df26dbe318ae1094cb4e732ba366dd9b01ee..283e01db3035765dd294f3f40e0d9f52e037da08 100644 --- a/uni_modules/uni-progress-notification/utssdk/app-android/TransparentActivity.uts +++ b/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts @@ -15,7 +15,7 @@ export class TransparentActivity extends Activity { override onCreate(savedInstanceState : Bundle | null) { super.onCreate(savedInstanceState) - this.fullScreen(this) + this.fullScreen(this) const action = this.getIntent().getAction() if (action == ACTION_DOWNLOAD_FINISH) { setTimeout(() => { diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/config.json b/uni_modules/uts-progressNotification/utssdk/app-android/config.json similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-android/config.json rename to uni_modules/uts-progressNotification/utssdk/app-android/config.json diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/constant.uts b/uni_modules/uts-progressNotification/utssdk/app-android/constant.uts similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-android/constant.uts rename to uni_modules/uts-progressNotification/utssdk/app-android/constant.uts diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/index.uts b/uni_modules/uts-progressNotification/utssdk/app-android/index.uts similarity index 96% rename from uni_modules/uni-progress-notification/utssdk/app-android/index.uts rename to uni_modules/uts-progressNotification/utssdk/app-android/index.uts index a04b7e0f97fe68ac67b05e5f5330e5d3b6c6ad20..39d14cd58fb17e0adf913bbd6995e5849345e313 100644 --- a/uni_modules/uni-progress-notification/utssdk/app-android/index.uts +++ b/uni_modules/uts-progressNotification/utssdk/app-android/index.uts @@ -111,7 +111,7 @@ function reset() { function createPendingIntent(context : Context, action : string) : PendingIntent { const i = new Intent(action); - i.setComponent(new ComponentName(context.getPackageName(), "uts.sdk.modules.uniProgressNotification.TransparentActivity")); + i.setComponent(new ComponentName(context.getPackageName(), "uts.sdk.modules.utsProgressNotification.TransparentActivity")); let flags = PendingIntent.FLAG_ONE_SHOT; if (Build.VERSION.SDK_INT >= 23) { flags = PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE; diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/res/values/notification_progress_styles.xml b/uni_modules/uts-progressNotification/utssdk/app-android/res/values/notification_progress_styles.xml similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-android/res/values/notification_progress_styles.xml rename to uni_modules/uts-progressNotification/utssdk/app-android/res/values/notification_progress_styles.xml diff --git a/uni_modules/uni-progress-notification/utssdk/app-ios/config.json b/uni_modules/uts-progressNotification/utssdk/app-ios/config.json similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-ios/config.json rename to uni_modules/uts-progressNotification/utssdk/app-ios/config.json diff --git a/uni_modules/uni-progress-notification/utssdk/app-ios/index.uts b/uni_modules/uts-progressNotification/utssdk/app-ios/index.uts similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-ios/index.uts rename to uni_modules/uts-progressNotification/utssdk/app-ios/index.uts diff --git a/uni_modules/uts-progressNotification/utssdk/interface.uts b/uni_modules/uts-progressNotification/utssdk/interface.uts new file mode 100644 index 0000000000000000000000000000000000000000..957035338481eed25cc286e7032bc4abd1ec6319 --- /dev/null +++ b/uni_modules/uts-progressNotification/utssdk/interface.uts @@ -0,0 +1,46 @@ +export type CreateNotificationProgressOptions = { + /** + * 通知标题 + * @defaultValue 应用名称 + */ + title ?: string | null + /** + * 通知内容 + */ + content : string, + /** + * 进度 + */ + progress : number, + /** + * 点击通知消息回调 + * @defaultValue null + */ + onClick? : (() => void) | null +} + + +export type FinishNotificationProgressOptions = { + /** + * 通知标题 + * @defaultValue 应用名称 + */ + title ?: string | null + /** + * 通知内容 + */ + content : string, + /** + * 点击通知消息回调 + */ + onClick : () => void +} + + +export type CreateNotificationProgress = (options : CreateNotificationProgressOptions) => void; + + +export type CancelNotificationProgress = () => void; + + +export type FinishNotificationProgress = (options: FinishNotificationProgressOptions) => void diff --git a/uni_modules/uni-progress-notification/utssdk/unierror.uts b/uni_modules/uts-progressNotification/utssdk/unierror.uts similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/unierror.uts rename to uni_modules/uts-progressNotification/utssdk/unierror.uts