diff --git a/data/web/corefork.telegram.org/api/bots/webapps.html b/data/web/corefork.telegram.org/api/bots/webapps.html index fe927bf45e..09e214413f 100644 --- a/data/web/corefork.telegram.org/api/bots/webapps.html +++ b/data/web/corefork.telegram.org/api/bots/webapps.html @@ -73,46 +73,48 @@

Both simple and normal can send web events starting with web_app_; see the web event documentation for the full list of events that can be sent by the web app to the client ».

Incoming events: Client to web app

Web apps can also receive events, by exposing a window.Telegram.WebView.receiveEvent("event_name", params) method.

-

Here's the full list of events that can be received by a web app from the client.

+

Here's the full list of events that can be received by a web app from the client, by calling the receiveEvent method.

phone_requested

Params: a JSON object containing an optional string phone_number field.

Sent in response to a web_app_request_phone outgoing event, see the docs for more info ».

+

main_button_pressed

+

Params: null

+

Sent by the client when the user presses the main button, if it was previously configured by a web_app_setup_main_button event.

+

settings_button_pressed

+

Params: null

+

Sent by the client when the user presses the settings button, if it was previously enabled in BotFather.

back_button_pressed

Params: null

-

Sent by the client when the user presses the back button, if it was previously enabled by a web_app_setup_back_button event

+

Sent by the client when the user presses the back button, if it was previously enabled by a web_app_setup_back_button event.

invoice_closed

Params: JSON object with the following fields:

-

settings_button_pressed

-

Params: null

-

Sent by the client when the user presses the settings button, if it was previously enabled in BotFather.

-

main_button_pressed

-

Params: null

-

Sent by the client when the user presses the main button, if it was previously configured by a web_app_setup_main_button event

viewport_changed

Params: a JSON object with the following fields:

+

Emitted when the viewport is changed.

theme_changed

Params: a JSON object with the following fields:

+

Emitted when requested by the web app using a web_app_request_theme event, or when the app theme changes.

popup_closed

Params: a JSON object with an optional button_id string field.

Emitted when the user presses a button or cancels a popup brought up by a previous web_app_open_popup event.

diff --git a/data/web/corefork.telegram.org/api/web-events.html b/data/web/corefork.telegram.org/api/web-events.html index a7611e2975..0a7b551411 100644 --- a/data/web/corefork.telegram.org/api/web-events.html +++ b/data/web/corefork.telegram.org/api/web-events.html @@ -139,25 +139,42 @@ The GamingCommunication and bot web app libraries by default will use '*'<

web_app_open_tg_link

Event data: a JSON object with a string path_full field, containing the path+query component of a t.me deep link.

Used to open a t.me deep link. The Web App will be closed.

-

web_app_setup_back_button

-

Event data: a JSON object with an is_visible boolean field.

-

Determines whether to show or hide the back button.

web_app_open_invoice

+

Event data: a JSON object with a string slug field

web_app_expand

No event payload.

Expands the web app to the maximum available height.

web_app_request_viewport

No event payload.

-

Used by web apps to request information about the viewport, clients should call window.Telegram.WebView.receiveEvent("viewport_changed", {})

+

Used by web apps to request information about the viewport, clients should emit a viewport_changed event

web_app_request_theme

+

No event payload.

+

Used by web apps to request information about the current theme, clients should emit a theme_changed event.

web_app_ready

+

No event payload.

+

Emitted by web apps when they are fully loaded.

web_app_setup_main_button

+

Event payload: JSON object with the following fields:

+ +

Configures the main button: when the user presses it a main_button_pressed event should be emitted by the client.

+

web_app_setup_back_button

+

Event data: a JSON object with an is_visible boolean field.

+

Determines whether to show or hide the back button: when the user presses it a back_button_pressed event should be emitted by the client.

payment_form_submit

Event payload: JSON object with credentials and title fields.

-

title is the censored credit card title.
-credentials is a service-specific JSON object with information about the payment credentials provided by the user to the payment system.
-Neither Telegram, nor bots will have access to your credit card information.
-Credit card details will be handled only by the payment system.

+ +

Neither Telegram, nor bots will have access to your credit card information.
+Credit card details will be handled only by the payment system, see the payment documentation for more info ».

share_score

No event payload.

Will be called by games when the user explicitly clicks on the share score button to share the game, along with his score.