yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.13k stars 1.49k forks source link

webapp not working via phone #1117

Open wiscoyt opened 10 months ago

wiscoyt commented 10 months ago

Hey! WebApp opens and displays content if open it through the PC, but not via phone. When I open it on my phone, I get a blank page.

"node-telegram-bot-api": "^0.61.0",

I'm using Nestjs + Nextjs

        if (telegramBot) {
            telegramBot.onText(/\/start/, (msg) => {
                const chatId = msg.chat.id;

                const appURL = process.env.BOT_URL + webAppUrl

                const inlineKeyboard = {
                    inline_keyboard: [
                        [
                            { text: '1', web_app: {url: appURL} },
                            { text: '2', web_app: {url: appURL} },
                        ],
                        [{ text: '3', web_app: {url: appURL} }],
                    ],
                };

                const replyMarkup = JSON.stringify(inlineKeyboard);

                const options = {
                    reply_markup: replyMarkup,
                };

                const welcomeMessage = `Hey! My id: ${botId}. Choose:`;

                this.sendMessageWithInlineKeyboard(botId, chatId, welcomeMessage, options);

Here is the part of the code how I call the webapp. I don't see any errors. If I set the Google page in the URL, then it will open from the phone. I don't understand what could be the problem when with the current code, my page opens only via PC, but on the phone - a blank screen.

In running ngrok I see my request, I get a successful response:

GET /catalog/9ea92010-4a7f-11ee-9ba1-304388321028 200 OK

zhilovhub commented 4 months ago

Hi! Did you solve your problem?