diff --git a/uni_modules/uts-openSchema/changelog.md b/uni_modules/uts-openSchema/changelog.md index b10de42616c1d10150011370f9b7bb0117ebdaa6..c77ddbd9bfc874320bc68ff83e15fd4432cc2c48 100644 --- a/uni_modules/uts-openSchema/changelog.md +++ b/uni_modules/uts-openSchema/changelog.md @@ -1,3 +1,5 @@ +## 1.1.1(2024-12-16) +- 修复 canOpenURL 在安卓端可能会报类型错误的问题 ## 1.1.0(2024-12-06) - 新增 canOpenURL UTS API,可用此API判断url是否可以跳转 ## 1.0.1(2024-11-13) diff --git a/uni_modules/uts-openSchema/package.json b/uni_modules/uts-openSchema/package.json index c3183f96d46830754b6df7594260b587ff52511e..c5a09f835aaed57c37d291027f9e01202da3bb37 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.1.0", + "version": "1.1.1", "description": "在 Android 和 iOS 上打开链接的 UTS API", "keywords": [ "uts-openSchema" diff --git a/uni_modules/uts-openSchema/utssdk/app-android/index.uts b/uni_modules/uts-openSchema/utssdk/app-android/index.uts index 145860dd13596fc7e877dbcf5e6cb50ccf663a59..683d39fc3e874dc95191fbf88db065a2766b84e3 100644 --- a/uni_modules/uts-openSchema/utssdk/app-android/index.uts +++ b/uni_modules/uts-openSchema/utssdk/app-android/index.uts @@ -15,12 +15,12 @@ export const openSchema : OpenSchema = function (url : string) { } } -export const canOpenURL : CanOpenURL = function (url : string) { +export const canOpenURL : CanOpenURL = function (url : string) : boolean { if (typeof url === 'string' && url.length > 0) { const context = UTSAndroid.getUniActivity()! const uri = Uri.parse(url) const intent = new Intent(Intent.ACTION_VIEW, uri) - return intent.resolveActivity(context.packageManager) != null + return intent.resolveActivity(context.packageManager) != null ? true : false } else { return false }