How to use the cozy-device-helper.openDeeplinkOrRedirect function in cozy-device-helper

To help you get started, we’ve selected a few cozy-device-helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy-ui / react / AppLinker / index.jsx View on Github external
static openNativeFromWeb(props, ev) {
    const { href, slug, nativePath, onAppSwitch } = props
    const appInfo = NATIVE_APP_INFOS[slug]

    if (ev) {
      ev.preventDefault()
    }

    AppLinker.onAppSwitch(onAppSwitch)
    openDeeplinkOrRedirect(
      appInfo.uri + (nativePath === '/' ? '' : nativePath),
      function() {
        window.location.href = href
      }
    )
  }