Closed jianbinking closed 3 weeks ago
tryBrowser
is undocumented by Telegram, so we can't rely on this parameter. You also should specify not true
, but the browser identifier.
Try using tryBrowser: 'safari'
. Until then, I don't know any other possible way of avoid opening the link outside the Telegram application. I don't think there is any
thanks @heyqbnk for your reply ~
I'm using the react version SDK
"@telegram-apps/sdk-react": "^1.1.3",
as you says, I tried to set the tryBrowser to safari, it no works
then I tried install the js version SDK and tried like this:
import { openLink } from '@telegram-apps/sdk';
openLink('https://telegram.org', {
tryBrowser: 'chrome',
tryInstantView: true,
});
but 1. try tryBrowser has no param 'safari', even I set the tryBrowser to 'safari' it still open the link in the safari app, NOT the inner safari browser
I found that the ton wallet tg mini app can open the explorer url in the inner safari browser, after check the their html code, they are using:
<a target="_blank" href="https://tonviewer.com/transaction/0b416d1c4dbb9c045063bc661c141faef9c1d26040c7a093737c0152b428c301" rel="noreferrer noopener">在区块链浏览器中查看</a>
however, as I tried to add this to my demo mini app, the page still open in the safari app, not inner safari quite amazing
Wait. Do you want to open the link in the internal Telegram browser or in the external one?
I want to open the link in the internal Telegram browser coz the link is a website dapp, can connect with other mini tg wallet apps
import {initUtils} from "@telegram-apps/sdk-react";
const utils = initUtils()
utils.openLink(url, {
tryInstantView: true,
tryBrowser: true
})
above code works well on android side, but on iOS side it can not open the link in the internal Telegram browser
I am not sure I can really help with this question. The problem is probably on the Telegram for iOS side. They should probably improve the openLink method to choose how to open the link exactly
Closing due to we have nothing to do here. Just waiting for this feature to be implemented by the Telegram devs
Telegram Application
Telegram for iOS
Describe the Bug
as a telegram mini app developer, I'm going to open a https link e.g. https://www.google.com/ but I will get jump into safari app and open this link, NOT open it in the telegram's inner safari browser I have tried these functions blow, none of them works, can anyone who have the same issue and found any solutions?
if use "_self" or "_parent", the website will open in the mini app's current page, which is not I want
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
open the page in the inner safari browser instead of safari app