MCPcopy Create free account
hub / github.com/Iterable/react-native-sdk / callUrlHandler

Function callUrlHandler

src/core/utils/callUrlHandler.ts:13–31  ·  view source on GitHub ↗
(
  config: IterableConfig,
  url: string,
  context: IterableActionContext
)

Source from the content-addressed store, hash-verified

11 * @param context - The context to use.
12 */
13export 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}

Callers 2

setupEventHandlersMethod · 0.90
handleClickMethod · 0.90

Calls 1

logMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…