Telegram-Mini-Apps / issues

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

`web_app_setup_closing_behavior` does not work in some cases #1

Open heyqbnk opened 1 year ago

heyqbnk commented 1 year ago

Describe the bug According to web_app_setup_closing_behavior method documentation, it should prevent user from losing important information in case, Web App is going to close.

Nevertheless, this method does not work correctly in iOS and Android. iOS, probably, implemented it a bit better. Application does not allow opening bot and chat information which could lead to Web App close somehow. For example, when user clicks some link in attachments or something like that. It just doesn't allow doing a lot of actions. Android works a bit different, it allows doing that which may lead to Web App close.

iOS and Android

Method does not work in case, user presses Menu Button, it just closes the Web App without showing confirmation dialog. The Web App will also be force closed in case, user pressed chat message input.

Android only

Method does not work in case, when Web App is minimized and user presses back button on the left from bot avatar. It closes Web App without confirmation dialog.

To Reproduce Steps to reproduce the behavior:

  1. Open Web Apps polygon bot (source code)
  2. Open developers tools
  3. Call Web Apps method:
    bridge.postEvent('web_app_setup_closing_behavior', {
    need_confirmation: true,
    });
  4. Try steps described in first section and see incorrect behavior.

Expected behavior Telegram application shows confirmation dialog in case, user or application action is going to close Web App. It probably should also work in case, app calls web_app_open_link and similar methods.

howardpen9 commented 1 year ago

can you write more in tutorial?

heyqbnk commented 1 year ago

@howardpen9 do you mean adding more information on how web_app_setup_closing_behavior works in Web Apps?