rewriteUrl function

String rewriteUrl(
  1. Uri url,
  2. UPIApp option
)

Implementation

String rewriteUrl(Uri url, UPIApp option) {
  // If the app supports intent launch, we use the intent scheme
  // else we use the deeplink scheme
  // intent is only supported on android
  if (PlatformUtils.isAndroid && option.supportsIntentLaunch) {
    return url
        .replace(
          scheme: option.intentScheme,
          path: option.intentPath,
          host: option.intentHost,
        )
        .toString();
  }

  return url
      .replace(
        scheme: option.deeplinkScheme,
        path: option.deeplinkPath,
        host: option.deeplinkHost,
      )
      .toString();
}