MadelineProtoDocs/docs/API_docs/methods/messages.requestAppWebView.md
2024-05-01 14:53:46 +02:00

3.0 KiB

title description grand_parent parent image redirect_from
messages.requestAppWebView Open a [bot mini app](https://core.telegram.org/bots/webapps) from a [direct Mini App deep link](https://core.telegram.org/api/links#direct-mini-app-links), sending over user information after user confirmation. Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_requestAppWebView.html

Method: messages.requestAppWebView

Back to methods index

Open a bot mini app from a direct Mini App deep link, sending over user information after user confirmation.

After calling this method, until the user closes the webview, messages.prolongWebView must be called every 60 seconds.

Parameters:

Name Type Description Required
write_allowed Bool Set this flag if the bot is asking permission to send messages to the user as specified in the direct Mini App deep link docs, and the user agreed. Optional
peer Username, chat ID, Update, Message or InputPeer If the client has clicked on the link in a Telegram chat, pass the chat's peer information; otherwise pass the bot's peer information, instead. Optional
app InputBotApp The app obtained by invoking messages.getBotApp as specified in the direct Mini App deep link docs. Yes
start_param string If the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param. Optional
theme_params DataJSON Theme parameters » Optional
platform string Short name of the application; 0-64 English letters, digits, and underscores Optional

Return type: AppWebViewResult

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$AppWebViewResult = $MadelineProto->messages->requestAppWebView(write_allowed: $Bool, peer: $InputPeer, app: $InputBotApp, start_param: 'string', theme_params: $DataJSON, platform: 'string', );