提交 d130a5ed 编写于 作者: VK1688's avatar VK1688

发布uts-openSchema 1.1.1

上级 30d65a13
## 1.1.1(2024-12-16)
- 修复 canOpenURL 在安卓端可能会报类型错误的问题
## 1.1.0(2024-12-06)
- 新增 canOpenURL UTS API,可用此API判断url是否可以跳转
## 1.0.1(2024-11-13)
......
{
"id": "uts-openSchema",
"displayName": "uts-openSchema",
"version": "1.1.0",
"version": "1.1.1",
"description": "在 Android 和 iOS 上打开链接的 UTS API",
"keywords": [
"uts-openSchema"
......
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册