Telegram-Mini-Apps / issues

Centralised storage of platform issues and enhancement proposals.
8 stars 1 forks source link

`popup_closed` event payload has different values on all platforms in case, it was closed due to click outside or by clicking the popup cross #3

Open heyqbnk opened 1 year ago

heyqbnk commented 1 year ago

Describe the bug Each platform sends different values in popup_closed event payload.

Android: {} Desktop: undefined iOS: null Web: { button_id: { isTrusted: true } }

To Reproduce Steps to reproduce the behavior:

  1. Open Web Apps polygon bot (source code)
  2. Open developers tools (F12)
  3. Show popup with this script:
    bridge.postEvent('web_app_open_popup', {
    title: 'Title',
    message: 'Message',
    buttons: [{type: 'ok', id: 'ok'}]
    })
  4. Close popup with click outside. In case, click outside close is not available (on desktop platforms), close popup by clicking top right popup cross.
  5. Event payload will differ depending on current platform

Expected behavior Event payload is the same on all platforms.

heyqbnk commented 1 year ago

Developers of Web version rolled up a new update. It now sends empty object ({}) in case, no button was clicked. At this point, we assume that bug in web version is fixed.

zubiden commented 1 year ago

Android behavior is correct according to https://corefork.telegram.org/api/web-events#web-app-open-popup Also, notice that the web version platform value changed to webz after the last update

heyqbnk commented 1 year ago

@zubiden Thank you for clarification and source to use as declaration of events. So then, we assume, that problem exists only in iOS and Desktop versions of Telegram. Going to re-check if something changed.

heyqbnk commented 1 year ago

tdesktop issue: https://github.com/telegramdesktop/tdesktop/issues/25767

heyqbnk commented 1 year ago

ios issue: https://github.com/TelegramMessenger/Telegram-iOS/issues/969