Telegram-iOS icon indicating copy to clipboard operation
Telegram-iOS copied to clipboard

[Telegram Mini Apps] `openLink` always opens external browser

Open kosheeta opened this issue 1 year ago • 2 comments

Checklist

  • [x] I am reporting an issue in existing functionality that does not work as intended
  • [x] I've searched for existing GitHub issues

Description

The Telegram.WebApp.openLink method on iOS always opens links in an external browser. There is no option to open the link in Telegram's in-app browser. In contrast, on Android, links open in the in-app browser by default. https://github.com/TelegramMessenger/Telegram-iOS/blob/45fa1b5ddb3a9a794bf407cb8d9bf2d0e4643b1f/submodules/WebUI/Sources/WebAppController.swift#L1140

Expected Behavior

Links opened using the openLink method in the Mini App should open in Telegram's in-app browser on iOS if the tryBrowser parameter is not explicitly specified, similar to the behavior on Android.

Actual Behavior

Links opened using the openLink method on iOS are always opened in an external browser, with no option to use the in-app browser.

Steps to Reproduce

  1. Call the openLink method with any valid URL and any tryBrowser value.
  2. Observe that the link is opened in an external browser.

Screenshots and Videos

<button onClick={() => Telegram.WebApp.openLink('https://example.com')}>
    Open link
</button>

https://github.com/user-attachments/assets/16d489d7-f5a8-4019-b64d-f80b5a5afd57

Environment

Device: iPhone 15 iOS version: 18.1 App version: 11.6.1

kosheeta avatar Jan 12 '25 14:01 kosheeta

Telegram ios doesn't support in app browser

linkvapeluckyman avatar May 02 '25 12:05 linkvapeluckyman

Telegram ios doesn't support in app browser

For example, a url_button opens link using in-app browser

kosheeta avatar May 02 '25 14:05 kosheeta