telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

problem with `start_params`

Open kasrakhamesi opened this issue 1 year ago • 22 comments

in this url for example : https://t.me/mybot?startapp=bbId38341612

when open it with telegram desktop, WebApp.initDataUnsafe.start_param working fine and get bbId38341612

but when I want open that with iphone 13 , always WebApp.initDataUnsafe.start_param is undefined, my project on react.js

and "@twa-dev/sdk": "^7.0.0", help me to fix that

I check https://github.com/TelegramMessenger/Telegram-iOS/issues/1091

but still have problem

kasrakhamesi avatar Aug 25 '24 19:08 kasrakhamesi

I have the same problem =(

Falasbyby avatar Aug 26 '24 13:08 Falasbyby

What is your app version?

levlam avatar Aug 26 '24 16:08 levlam

I have the same problem =(

Studiobaraban avatar Aug 27 '24 04:08 Studiobaraban

What is your app version?

last

Falasbyby avatar Aug 27 '24 07:08 Falasbyby

"last" isn't a version of an app.

levlam avatar Aug 27 '24 09:08 levlam

I work in unity (webgl) via telegram bot mini api July 31, 2024 Bot API 7.8

Falasbyby avatar Aug 27 '24 09:08 Falasbyby

in this url for example : https://t.me/mybot?startapp=bbId38341612

when open it with telegram desktop, WebApp.initDataUnsafe.start_param working fine and get bbId38341612

but when I want open that with iphone 13 , always WebApp.initDataUnsafe.start_param is undefined, my project on react.js

and "@twa-dev/sdk": "^7.0.0", help me to fix that

I check TelegramMessenger/Telegram-iOS#1091

but still have problem

I have solved this problem!!! /newapp in the bot wrote and filled in all the data!

t.me/My_bot - was t.me/My_bot/appname - became

Falasbyby avatar Aug 28 '24 07:08 Falasbyby

same issue, "?startapp=command" works on fine on desktop to fill start_param but when i try using this on android then start_param stays undefined

bobpepers avatar Sep 23 '24 09:09 bobpepers

@bobpepers

What is your exact app version? What link do you use for testing?

levlam avatar Sep 23 '24 10:09 levlam

@bobpepers

What is your exact app version? What link do you use for testing?

I'm building a React application using the latest version of @twa-dev/sdk (v7.10.1). My test link is: https://t.me/SecretTip_dev_bot?startapp=SecretTip

The following code works fine on desktop (Ubuntu 24.04):

await ctx.replyWithHTML(message, {
  reply_markup: {
    inline_keyboard: [
      [
        {
          text: 'Open Mini App',
          url: miniAppUrl, // URL that opens the mini-app directly in Telegram
        },
      ],
    ],
  },
});

However, when testing on Android, the start_param is not available when using the startapp=testParameter. One key requirement for my Telegram mini-app is that it needs to be opened from a Telegram group because I rely on the initData to determine the group from which the app was initiated.

I haven't tested this on any other operating systems yet.

bobpepers avatar Sep 24 '24 04:09 bobpepers

Is bug fixed? Maybe some workarounds?

skrradev avatar Sep 26 '24 20:09 skrradev

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot using /newapp. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params as Rick

VietnameseRick avatar Sep 26 '24 22:09 VietnameseRick

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params

This was it. I didn’t realize setting up a web app through BotFather was something I had to do. It worked fine on desktop, so I didn’t catch that it was necessary step for phones. Thank you.

bobpepers avatar Sep 27 '24 02:09 bobpepers

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params

I have ennabled the miniapp in the bot settings, but I still can't get the start_param in iOS and Android

AlansaladA avatar Sep 27 '24 03:09 AlansaladA

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params

This was it. I didn’t realize setting up a web app through BotFather was something I had to do. It worked fine on desktop, so I didn’t catch that it was necessary step for phones. Thank you.

Hi @bobpepers ,Can you tell me where webapp_name is set?

AlansaladA avatar Sep 27 '24 04:09 AlansaladA

If you want to get the webapp_name, use /newapp to create an app for your bot.

AlansaladA avatar Sep 27 '24 06:09 AlansaladA

Still getting this error on Telegram for Android v11.1.3 (5243)

When opening miniapp using t.me/bot_name?startapp=testParameter - start_param is available on Windows Desktop, but unavailable on MacOS Desktop, iOS and Android

Default webapp t.me/bot_name/webapp_name?startapp=testParameter works fine

belyaev-dev avatar Oct 01 '24 08:10 belyaev-dev

in this url for example : https://t.me/mybot?startapp=bbId38341612 when open it with telegram desktop, WebApp.initDataUnsafe.start_param working fine and get bbId38341612 but when I want open that with iphone 13 , always WebApp.initDataUnsafe.start_param is undefined, my project on react.js and "@twa-dev/sdk": "^7.0.0", help me to fix that I check TelegramMessenger/Telegram-iOS#1091 but still have problem

I have solved this problem!!! /newapp in the bot wrote and filled in all the data!

t.me/My_bot - was t.me/My_bot/appname - became

i also have same problem my link is like https://t.me/masterversess_bot?startapp=${referralId}` this and i am not getting the start_param in initdata why canyou please help me what will i do . do i need to update the url

ami-in avatar Oct 07 '24 11:10 ami-in

Still getting this error on Telegram for Android v11.1.3 (5243)

When opening miniapp using t.me/bot_name?startapp=testParameter - start_param is available on Windows Desktop, but unavailable on MacOS Desktop, iOS and Android

Default webapp t.me/bot_name/webapp_name?startapp=testParameter works fine

how to get the webapp_name where i get this and i am created an mini app t.me/testmasterversepray_bot/testmaster?startapp=7472847113 the botname is that mini app name is testmaster but it showing the bot not found please help

ami-in avatar Oct 07 '24 11:10 ami-in

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params

This was it. I didn’t realize setting up a web app through BotFather was something I had to do. It worked fine on desktop, so I didn’t catch that it was necessary step for phones. Thank you.

Hi @bobpepers ,Can you tell me where webapp_name is set?

same issue for me https://t.me/masterversess_bot/Masterverses?startapp=7472847113 i updated my link like this and it showing bot not found webapp_name is the bot name? can you please help if you get solution

ami-in avatar Oct 07 '24 11:10 ami-in

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params

This was it. I didn’t realize setting up a web app through BotFather was something I had to do. It worked fine on desktop, so I didn’t catch that it was necessary step for phones. Thank you.

Hi @bobpepers ,Can you tell me where webapp_name is set?

same issue for me https://t.me/masterversess_bot/Masterverses?startapp=7472847113 i updated my link like this and it showing bot not found webapp_name is the bot name? can you please help if you get solution

Go to botfather, create /newapp and fill all the details. add weburl you will get complete link in myapps

SurajG20 avatar Oct 12 '24 10:10 SurajG20

for anyone having problem like this, try talk to BotFather and setup a webapp for your bot. After finish, depends on your setting the link will be like t.me/bot_name/webapp_name then when you open t.me/bot_name/webapp_name?startapp=Rick your webapp will be able to get startapp params

This was it. I didn’t realize setting up a web app through BotFather was something I had to do. It worked fine on desktop, so I didn’t catch that it was necessary step for phones. Thank you.

Hi @bobpepers ,Can you tell me where webapp_name is set?

same issue for me https://t.me/masterversess_bot/Masterverses?startapp=7472847113 i updated my link like this and it showing bot not found webapp_name is the bot name? can you please help if you get solution

Go to botfather, create /newapp and fill all the details. add weburl you will get complete link in myapps

thank for it . my issue is resolved when i created and webapp for my miniapp <333

ami-in avatar Oct 24 '24 06:10 ami-in

@belyaev-dev Could you confirm that the issue was fixed in the latest versions of macOS Desktop, iOS and Android apps?

levlam avatar Jan 03 '25 12:01 levlam