首次完整推送,
V:1.20240808.006
This commit is contained in:
2
uni_modules/uts-openSchema/changelog.md
Normal file
2
uni_modules/uts-openSchema/changelog.md
Normal file
@ -0,0 +1,2 @@
|
||||
## 1.0.0(2024-04-25)
|
||||
- 更新 在 Android 和 iOS 上打开链接的 UTS API
|
82
uni_modules/uts-openSchema/package.json
Normal file
82
uni_modules/uts-openSchema/package.json
Normal file
@ -0,0 +1,82 @@
|
||||
{
|
||||
"id": "uts-openSchema",
|
||||
"displayName": "uts-openSchema",
|
||||
"version": "1.0.0",
|
||||
"description": "在 Android 和 iOS 上打开链接的 UTS API",
|
||||
"keywords": [
|
||||
"uts-openSchema"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^4.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"type": "uts",
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y",
|
||||
"alipay": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "n",
|
||||
"vue3": "y"
|
||||
},
|
||||
"App": {
|
||||
"app-android": "y",
|
||||
"app-ios": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "n",
|
||||
"Android Browser": "n",
|
||||
"微信浏览器(Android)": "n",
|
||||
"QQ浏览器(Android)": "n"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "n",
|
||||
"IE": "n",
|
||||
"Edge": "n",
|
||||
"Firefox": "n",
|
||||
"Safari": "n"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "n",
|
||||
"阿里": "n",
|
||||
"百度": "n",
|
||||
"字节跳动": "n",
|
||||
"QQ": "n",
|
||||
"钉钉": "n",
|
||||
"快手": "n",
|
||||
"飞书": "n",
|
||||
"京东": "n"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "n",
|
||||
"联盟": "n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
uni_modules/uts-openSchema/readme.md
Normal file
6
uni_modules/uts-openSchema/readme.md
Normal file
@ -0,0 +1,6 @@
|
||||
# uts-openSchema
|
||||
### 开发文档
|
||||
[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html)
|
||||
[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)
|
||||
[UTS 组件插件](https://uniapp.dcloud.net.cn/plugin/uts-component.html)
|
||||
[Hello UTS](https://gitcode.net/dcloud/hello-uts)
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"minSdkVersion": "21"
|
||||
}
|
15
uni_modules/uts-openSchema/utssdk/app-android/index.uts
Normal file
15
uni_modules/uts-openSchema/utssdk/app-android/index.uts
Normal file
@ -0,0 +1,15 @@
|
||||
import Intent from 'android.content.Intent'
|
||||
import Uri from 'android.net.Uri'
|
||||
import { OpenSchema } from '../interface.uts'
|
||||
|
||||
export const openSchema: OpenSchema = function (url: string) {
|
||||
if (typeof url === 'string' && url.length > 0) {
|
||||
const context = UTSAndroid.getUniActivity()!
|
||||
const uri = Uri.parse(url)
|
||||
const intent = new Intent(Intent.ACTION_VIEW, uri)
|
||||
intent.setData(uri)
|
||||
context.startActivity(intent)
|
||||
} else {
|
||||
console.error('url param ERROR:', JSON.stringify(url))
|
||||
}
|
||||
}
|
3
uni_modules/uts-openSchema/utssdk/app-ios/config.json
Normal file
3
uni_modules/uts-openSchema/utssdk/app-ios/config.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"deploymentTarget": "12.0"
|
||||
}
|
14
uni_modules/uts-openSchema/utssdk/app-ios/index.uts
Normal file
14
uni_modules/uts-openSchema/utssdk/app-ios/index.uts
Normal file
@ -0,0 +1,14 @@
|
||||
import { OpenSchema } from '../interface.uts'
|
||||
|
||||
export const openSchema: OpenSchema = function(url: string): void {
|
||||
if (typeof url == 'string' && url.length > 0) {
|
||||
let uri = new URL(string = url)
|
||||
if (uri != null && UIApplication.shared.canOpenURL(uri!)) {
|
||||
UIApplication.shared.open(uri!, options = new Map<UIApplication.OpenExternalURLOptionsKey, any>(), completionHandler = null)
|
||||
}else {
|
||||
console.error('url param Error: ', url)
|
||||
}
|
||||
}else {
|
||||
console.error('url param Error: ', url)
|
||||
}
|
||||
}
|
1
uni_modules/uts-openSchema/utssdk/interface.uts
Normal file
1
uni_modules/uts-openSchema/utssdk/interface.uts
Normal file
@ -0,0 +1 @@
|
||||
export type OpenSchema = (url: string) => void
|
Reference in New Issue
Block a user