From 1cee35d4fb2b7eaaa7fbd6aa08b28e3e00dcc7dc Mon Sep 17 00:00:00 2001 From: Jason Cassidy <47318351+jcassidyav@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:57:52 +0100 Subject: [PATCH] fix(ios): replace deprecated UIApplication.shared.openUrl method call (#10627) --- packages/core/utils/index.ios.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/utils/index.ios.ts b/packages/core/utils/index.ios.ts index 5ea39931c..2d4d25da2 100644 --- a/packages/core/utils/index.ios.ts +++ b/packages/core/utils/index.ios.ts @@ -1,5 +1,5 @@ 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 * from './common'; @@ -39,7 +39,8 @@ export function openUrl(location: string): boolean { try { const url = NSURL.URLWithString(location.trim()); if (UIApplication.sharedApplication.canOpenURL(url)) { - return UIApplication.sharedApplication.openURL(url); + UIApplication.sharedApplication.openURLOptionsCompletionHandler(url, dataSerialize({}), null); + return true; } } catch (e) { // We Don't do anything with an error. We just output it