ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
326 stars 92 forks source link

[TONCONNECT-UI]: TonConnect works in the browser, but does not work inside of Telegram MiniApp. #230

Open KernelPanic0 opened 3 months ago

KernelPanic0 commented 3 months ago

Describe the bug

I have a telegram mini app that opens a tonconnect application. Whenever I connect my wallet through the regular browser (Firefox) using the Tonkeeper wallet, Tonkeeper immediately opens up and I get prompted to accept the connection. However when I do the same in the telegram mini app, the tonkeeper wallet does not automatically open. Instead, tonconnect simply infinitely loads. I have added some remotejs code into my webapp which allows for me to remotely view the console of the app running in the miniapp, however there are no errors that point out any obvious flaws... Even when opening the link in the browser externally, it does not immediately invoke the opening of Tonkeeper.

Here is the code (Vue.js framework) `const tonConnectUI = new TON_CONNECT_UI.TonConnectUI({ manifestUrl: 'url', buttonRootId: 'connect-div' });

    const acceptOfferButton = document.getElementById('accept-offer');
    // eslint-disable-next-line

    async function showTonConnectPopup() {
        try {
            // Initialize the connection to the TonConnect wallet
            await tonConnectUI.openModal();

        } catch(e) { console.log(e) }
    }

    acceptOfferButton.addEventListener('click', showTonConnectPopup)

    tonConnectUI.onStatusChange(async walletInfo => {
    if (walletInfo) {...`

Expected behavior

Tonconnect opens the Tonkeeper wallet after clicking connect, just like it would in the browser.

Current behavior

Tonconnect infinitely loads.

Steps to Reproduce

Unsure

Environment

Telegram MiniApp

Additional context

No response

KernelPanic0 commented 3 months ago

Still having this problem...

AvetikNersisyan commented 2 months ago

Did you find the solution? I still have the same issue.

ameeetgaikwad commented 1 month ago

let me know as well

iArchin commented 1 month ago

same

KernelPanic0 commented 1 month ago

If I remember correctly someone mentioned that this may be an issue of versions and using an older version may not have this issue. Sorry if this isnt very helpful