Skip to content

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

Description

@KernelPanic0

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions