MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / openUrlAsync

Function openUrlAsync

packages/core/utils/index.ios.ts:90–107  ·  view source on GitHub ↗
(location: string)

Source from the content-addressed store, hash-verified

88}
89
90export function openUrlAsync(location: string): Promise<boolean> {
91 return new Promise<boolean>((resolve, reject) => {
92 try {
93 const url = NSURL.URLWithString(location.trim());
94 const app = UIApplication.sharedApplication;
95 if (app.canOpenURL(url)) {
96 app.openURLOptionsCompletionHandler(url, null, (success: boolean) => {
97 resolve(success);
98 });
99 } else {
100 resolve(false);
101 }
102 } catch (e) {
103 Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
104 reject(e);
105 }
106 });
107}
108
109export const ad = 0;
110

Callers 1

openUrlFunction · 0.70

Calls 2

writeMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected