( config: IterableConfig, url: string, context: IterableActionContext )
| 11 | * @param context - The context to use. |
| 12 | */ |
| 13 | export function callUrlHandler( |
| 14 | config: IterableConfig, |
| 15 | url: string, |
| 16 | context: IterableActionContext |
| 17 | ) { |
| 18 | if (!config.urlHandler?.(url, context)) { |
| 19 | Linking.canOpenURL(url) |
| 20 | .then((canOpen) => { |
| 21 | if (canOpen) { |
| 22 | Linking.openURL(url); |
| 23 | } else { |
| 24 | IterableLogger?.log('Url cannot be opened: ' + url); |
| 25 | } |
| 26 | }) |
| 27 | .catch((reason) => { |
| 28 | IterableLogger?.log('Error opening url: ' + reason); |
| 29 | }); |
| 30 | } |
| 31 | } |
no test coverage detected
searching dependent graphs…