From 967e558b270ea51c4a21f0a073f3bbc34f8fede8 Mon Sep 17 00:00:00 2001 From: VK <370725567@qq.com> Date: Wed, 13 Nov 2024 20:09:23 +0800 Subject: [PATCH] update: uts-openSchema --- uni_modules/uts-openSchema/changelog.md | 2 ++ uni_modules/uts-openSchema/package.json | 7 ++++--- uni_modules/uts-openSchema/utssdk/app-android/index.uts | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/uni_modules/uts-openSchema/changelog.md b/uni_modules/uts-openSchema/changelog.md index cb0bf4d9..72f03745 100644 --- a/uni_modules/uts-openSchema/changelog.md +++ b/uni_modules/uts-openSchema/changelog.md @@ -1,2 +1,4 @@ +## 1.0.1(2024-11-13) +- 修复 Android 打开部分 schema 时没有跳转到目标应用的 Bug ## 1.0.0(2024-04-25) - 更新 在 Android 和 iOS 上打开链接的 UTS API diff --git a/uni_modules/uts-openSchema/package.json b/uni_modules/uts-openSchema/package.json index 78c3ee37..532597de 100644 --- a/uni_modules/uts-openSchema/package.json +++ b/uni_modules/uts-openSchema/package.json @@ -1,7 +1,7 @@ { "id": "uts-openSchema", "displayName": "uts-openSchema", - "version": "1.0.0", + "version": "1.0.1", "description": "在 Android 和 iOS 上打开链接的 UTS API", "keywords": [ "uts-openSchema" @@ -45,8 +45,9 @@ "vue3": "y" }, "App": { - "app-android": "y", - "app-ios": "y" + "app-android": "y", + "app-ios": "y", + "app-harmony": "u" }, "H5-mobile": { "Safari": "n", diff --git a/uni_modules/uts-openSchema/utssdk/app-android/index.uts b/uni_modules/uts-openSchema/utssdk/app-android/index.uts index 660c99e2..10d741a3 100644 --- a/uni_modules/uts-openSchema/utssdk/app-android/index.uts +++ b/uni_modules/uts-openSchema/utssdk/app-android/index.uts @@ -7,6 +7,7 @@ export const openSchema: OpenSchema = function (url: string) { const context = UTSAndroid.getUniActivity()! const uri = Uri.parse(url) const intent = new Intent(Intent.ACTION_VIEW, uri) + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) intent.setData(uri) context.startActivity(intent) } else { -- GitLab