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

Function openUrl

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

Source from the content-addressed store, hash-verified

73}
74
75export function openUrl(location: string): boolean {
76 try {
77 const url = NSURL.URLWithString(location.trim());
78 if (UIApplication.sharedApplication.canOpenURL(url)) {
79 openUrlAsync(location);
80 return true;
81 }
82 } catch (e) {
83 // We Don't do anything with an error. We just output it
84 Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
85 }
86
87 return false;
88}
89
90export function openUrlAsync(location: string): Promise<boolean> {
91 return new Promise<boolean>((resolve, reject) => {

Callers 1

Calls 2

openUrlAsyncFunction · 0.70
writeMethod · 0.65

Tested by

no test coverage detected