(location: string)
| 73 | } |
| 74 | |
| 75 | export 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 | |
| 90 | export function openUrlAsync(location: string): Promise<boolean> { |
| 91 | return new Promise<boolean>((resolve, reject) => { |
no test coverage detected