Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_39881186
uni-api
提交
8011041a
U
uni-api
项目概览
qq_39881186
/
uni-api
与 Fork 源项目一致
Fork自
DCloud / uni-api
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8011041a
编写于
12月 11, 2023
作者:
taohebin@dcloud.io
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 改名uts-progressNotification,并且不挂到uni下,需显示导入。
上级
e05bf0a9
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
72 addition
and
188 deletion
+72
-188
uni_modules/uni-progress-notification/utssdk/interface.uts
uni_modules/uni-progress-notification/utssdk/interface.uts
+0
-145
uni_modules/uts-progressNotification/changelog.md
uni_modules/uts-progressNotification/changelog.md
+7
-0
uni_modules/uts-progressNotification/package.json
uni_modules/uts-progressNotification/package.json
+6
-34
uni_modules/uts-progressNotification/readme.md
uni_modules/uts-progressNotification/readme.md
+8
-4
uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml
...ogressNotification/utssdk/app-android/AndroidManifest.xml
+3
-3
uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts
...ssNotification/utssdk/app-android/TransparentActivity.uts
+1
-1
uni_modules/uts-progressNotification/utssdk/app-android/config.json
...s/uts-progressNotification/utssdk/app-android/config.json
+0
-0
uni_modules/uts-progressNotification/utssdk/app-android/constant.uts
.../uts-progressNotification/utssdk/app-android/constant.uts
+0
-0
uni_modules/uts-progressNotification/utssdk/app-android/index.uts
...les/uts-progressNotification/utssdk/app-android/index.uts
+1
-1
uni_modules/uts-progressNotification/utssdk/app-android/res/values/notification_progress_styles.xml
...k/app-android/res/values/notification_progress_styles.xml
+0
-0
uni_modules/uts-progressNotification/utssdk/app-ios/config.json
...dules/uts-progressNotification/utssdk/app-ios/config.json
+0
-0
uni_modules/uts-progressNotification/utssdk/app-ios/index.uts
...modules/uts-progressNotification/utssdk/app-ios/index.uts
+0
-0
uni_modules/uts-progressNotification/utssdk/interface.uts
uni_modules/uts-progressNotification/utssdk/interface.uts
+46
-0
uni_modules/uts-progressNotification/utssdk/unierror.uts
uni_modules/uts-progressNotification/utssdk/unierror.uts
+0
-0
未找到文件。
uni_modules/uni-progress-notification/utssdk/interface.uts
已删除
100644 → 0
浏览文件 @
e05bf0a9
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
uni_modules/u
ni-progress-n
otification/changelog.md
→
uni_modules/u
ts-progressN
otification/changelog.md
浏览文件 @
8011041a
## 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
...
...
uni_modules/u
ni-progress-n
otification/package.json
→
uni_modules/u
ts-progressN
otification/package.json
浏览文件 @
8011041a
{
"id"
:
"u
ni-progress-n
otification"
,
"displayName"
:
"u
ni-progress-n
otification"
,
"version"
:
"1.0.
4
"
,
"description"
:
"u
ni-progress-n
otification"
,
"id"
:
"u
ts-progressN
otification"
,
"displayName"
:
"u
ts-progressN
otification"
,
"version"
:
"1.0.
7
"
,
"description"
:
"u
ts-progressN
otification"
,
"keywords"
:
[
"u
ni-progress-n
otification"
"u
ts-progressN
otification"
],
"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
}
uni_modules/u
ni-progress-n
otification/readme.md
→
uni_modules/u
ts-progressN
otification/readme.md
浏览文件 @
8011041a
# u
ni-download-n
otification
# u
ts-progressN
otification
## 使用说明
## 使用说明
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,比如下载完成后需要显示下载完成并隐藏进度时调用。
...
...
uni_modules/u
ni-progress-n
otification/utssdk/app-android/AndroidManifest.xml
→
uni_modules/u
ts-progressN
otification/utssdk/app-android/AndroidManifest.xml
浏览文件 @
8011041a
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"uts.sdk.modules.u
niPush
"
>
package=
"uts.sdk.modules.u
tsProgressNotification
"
>
<uses-permission
android:name=
"android.permission.POST_NOTIFICATIONS"
/>
<application>
<activity
android:name=
"uts.sdk.modules.u
ni
ProgressNotification.TransparentActivity"
<activity
android:name=
"uts.sdk.modules.u
ts
ProgressNotification.TransparentActivity"
android:theme=
"@style/DCNotificationProgressTranslucentTheme"
android:hardwareAccelerated=
"true"
android:screenOrientation=
"user"
android:exported=
"true"
>
</activity>
</application>
</manifest>
\ No newline at end of file
</manifest>
uni_modules/u
ni-progress-n
otification/utssdk/app-android/TransparentActivity.uts
→
uni_modules/u
ts-progressN
otification/utssdk/app-android/TransparentActivity.uts
浏览文件 @
8011041a
...
...
@@ -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(() => {
...
...
uni_modules/u
ni-progress-n
otification/utssdk/app-android/config.json
→
uni_modules/u
ts-progressN
otification/utssdk/app-android/config.json
浏览文件 @
8011041a
文件已移动
uni_modules/u
ni-progress-n
otification/utssdk/app-android/constant.uts
→
uni_modules/u
ts-progressN
otification/utssdk/app-android/constant.uts
浏览文件 @
8011041a
文件已移动
uni_modules/u
ni-progress-n
otification/utssdk/app-android/index.uts
→
uni_modules/u
ts-progressN
otification/utssdk/app-android/index.uts
浏览文件 @
8011041a
...
...
@@ -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.u
ni
ProgressNotification.TransparentActivity"));
i.setComponent(new ComponentName(context.getPackageName(), "uts.sdk.modules.u
ts
ProgressNotification.TransparentActivity"));
let flags = PendingIntent.FLAG_ONE_SHOT;
if (Build.VERSION.SDK_INT >= 23) {
flags = PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE;
...
...
uni_modules/u
ni-progress-n
otification/utssdk/app-android/res/values/notification_progress_styles.xml
→
uni_modules/u
ts-progressN
otification/utssdk/app-android/res/values/notification_progress_styles.xml
浏览文件 @
8011041a
文件已移动
uni_modules/u
ni-progress-n
otification/utssdk/app-ios/config.json
→
uni_modules/u
ts-progressN
otification/utssdk/app-ios/config.json
浏览文件 @
8011041a
文件已移动
uni_modules/u
ni-progress-n
otification/utssdk/app-ios/index.uts
→
uni_modules/u
ts-progressN
otification/utssdk/app-ios/index.uts
浏览文件 @
8011041a
文件已移动
uni_modules/uts-progressNotification/utssdk/interface.uts
0 → 100644
浏览文件 @
8011041a
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
uni_modules/u
ni-progress-n
otification/utssdk/unierror.uts
→
uni_modules/u
ts-progressN
otification/utssdk/unierror.uts
浏览文件 @
8011041a
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录