Class

DeeplinksApi

DeeplinksApi()

Deeplinking Hooks. Instance name: deeplinksApi

Hooks to modify deeplink behaviour/options when users tap on a link within the app.

Constructor

# new DeeplinksApi()

Example
externalCodeSetup.deeplinksApi.METHOD_NAME

Methods

# setDeeplinksReturnValueFilter(deeplinksWithoutEmbeddedReturnValueFilter)

Sets a function which decides what happens if deep linking fails to match the route. If the function returns true and deep linking fails, navigating to the WebView screen (as a default fallback) will not happen.

Parameters:
Name Type Description
deeplinksWithoutEmbeddedReturnValueFilter DeeplinksWithoutEmbeddedCallback
Example

Deep linking to route "inapp" fails so user would like to redirect to a different page instead

externalCodeSetup.deeplinksApi.setDeeplinksReturnValueFilter((defaultValue, linkObject, navigationService) => {
  if (linkObject.action === "inapp") {
     navigationService.navigate({
       routeName: "PageScreen",
      params: {
        url: "https://link-to-url.com"
      }
     })
  }
  return true;
});

# setDeeplinksWithoutEmbeddedReturnValueFilter(deeplinksWithoutEmbeddedReturnValueFilter)

Sets a function which decides if deep linking will happen. If the function returns true, deep linking will not happen. This is used to stop deep linking or to even try to match the route and fallback to open links in a WebView screen if the subject of navigation is not supported. You can put conditions to use this behaviour across multiple areas or one specific area within the app.

Parameters:
Name Type Description
deeplinksWithoutEmbeddedReturnValueFilter DeeplinksWithoutEmbeddedCallback
Example

Deep linking to profile screen will redirect to a url using page screen

externalCodeSetup.deeplinksApi.setDeeplinksWithoutEmbeddedReturnValueFilter((defaultValue, linkObject, navigationService) => {
 if (linkObject.action === "open_member_profile") {
  navigationService.navigate({
    routeName: "PageScreen",
    params: {
      url: "https://link-to-url.com"
    }
  })
 }
 return true;
});

# setExternalLinkNavigate(externalLinkNavigate)

Parameters:
Name Type Description
externalLinkNavigate ExternalLinkNavigation
Deprecated:
  • Yes