@tonconnect/ui 2.0.1-beta.2 → 2.0.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -8334,7 +8334,7 @@ function redirectToTelegram(universalLink, options) {
8334
8334
  openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options));
8335
8335
  }
8336
8336
  } else {
8337
- if (isOS("ios", "android")) {
8337
+ if (isOS("ios")) {
8338
8338
  if (options.returnStrategy === "back") {
8339
8339
  options.returnStrategy = location.href;
8340
8340
  }
@@ -8355,6 +8355,25 @@ function redirectToTelegram(universalLink, options) {
8355
8355
  );
8356
8356
  openLinkBlank(linkWithStrategy);
8357
8357
  }
8358
+ } else if (isOS("android")) {
8359
+ options.returnStrategy = "none";
8360
+ const isChrome = isBrowser("chrome");
8361
+ const isFirefox = isBrowser("firefox");
8362
+ const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect;
8363
+ if (useDeepLink) {
8364
+ const linkWithStrategy = addReturnStrategy(
8365
+ directLinkUrl.toString(),
8366
+ options.returnStrategy
8367
+ );
8368
+ const deepLink = convertToTGDeepLink(linkWithStrategy);
8369
+ openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy));
8370
+ } else {
8371
+ const linkWithStrategy = addReturnStrategy(
8372
+ directLinkUrl.toString(),
8373
+ options.returnStrategy
8374
+ );
8375
+ openLinkBlank(linkWithStrategy);
8376
+ }
8358
8377
  } else if (isOS("macos", "windows", "linux")) {
8359
8378
  options.returnStrategy = "none";
8360
8379
  options.twaReturnUrl = void 0;