mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(ios): replace deprecated UIApplication.shared.openUrl method call (#10627)
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { Trace } from '../trace';
|
import { Trace } from '../trace';
|
||||||
import { ios as iOSUtils } from './native-helper';
|
import { dataSerialize, ios as iOSUtils } from './native-helper';
|
||||||
|
|
||||||
export { clearInterval, clearTimeout, setInterval, setTimeout } from '../timer';
|
export { clearInterval, clearTimeout, setInterval, setTimeout } from '../timer';
|
||||||
export * from './common';
|
export * from './common';
|
||||||
@ -39,7 +39,8 @@ export function openUrl(location: string): boolean {
|
|||||||
try {
|
try {
|
||||||
const url = NSURL.URLWithString(location.trim());
|
const url = NSURL.URLWithString(location.trim());
|
||||||
if (UIApplication.sharedApplication.canOpenURL(url)) {
|
if (UIApplication.sharedApplication.canOpenURL(url)) {
|
||||||
return UIApplication.sharedApplication.openURL(url);
|
UIApplication.sharedApplication.openURLOptionsCompletionHandler(url, dataSerialize({}), null);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// We Don't do anything with an error. We just output it
|
// We Don't do anything with an error. We just output it
|
||||||
|
Reference in New Issue
Block a user