Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
691 stars 191 forks source link

[Bug]: The openLink method is unable to open external browsers on Xiaomi phones. #557

Closed Eacolt closed 1 day ago

Eacolt commented 2 days ago

Telegram Application

Telegram for Android

Describe the Bug

I am using @telegram-apps/sdk to develop a Telegram mini app on my H5 page. However, the behavior of openLink is inconsistent on Android and iOS phones. On iOS, calling openLink opens the external browser Safari, but on Android phones, calling openLink does not open the external default browser! Why is this happening, please help me! Below is the code for calling openLink: import { init, TelegramWebApps, isMiniAppSupported, shareURL, retrieveLaunchParams, openLink, openTelegramLink, } from "@telegram-apps/sdk";

// Unable to open external links on Android phones.

openLink("https://....", { tryInstantView:false }

To Reproduce

Steps to reproduce the behavior:

  1. Open the Telegram app on your Android phone.
  2. Launch my Telegram mini app.
  3. Tap the button to invoke the openLink method.
  4. Instead of opening the external link, the link opens within the current Telegram interface.

Expected Behavior

I want to use openLink in Telegram on Xiaomi's Android devices to open external browsers instead of the internal browser.

heyqbnk commented 1 day ago

The iOS version of Telegram has a setting in the "Data and Storage" section related to the browser to be chosen for the link.

Surely, there is something like that in Android.