khamidjon-khamidov / flutter_telegram_web_app

MIT License
12 stars 6 forks source link

I can't get user photo_url and some user's first name #2

Open farshid-shokrolahi opened 3 weeks ago

farshid-shokrolahi commented 3 weeks ago

Hi there. Thank you for your great package.

There is no photo_url in initData.user and when I use initDataUnsafe?.user?.photo_url I get a null value. Also for some users, the first_name is null. and I know they have first name in their telegram accounts.

Please let me know if I did something wrong. Thanks

khamidjon-khamidov commented 3 weeks ago

Hi @farshid-shokrolahi . Thanks for opening the issue). According to the documentation photo url is "Optional. URL of the user’s profile photo. The photo can be in .jpeg or .svg formats. Only returned for Mini Apps launched from the attachment menu.". The user should open the bot from attachment menu which is currently available for advertisers or test env.

Regarding first_name, I cannot reproduce the issue. You should check if they entered their full name to only one field (first name or last name).

khamidjon-khamidov commented 52 minutes ago

@farshid-shokrolahi I will close this issue if I don't get any updates from you