index.uts 500 字节
Newer Older
D
DCloud_LXH 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 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)
	}
}