Link Search Menu Expand Document

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:

NameTypeDescriptionRequired
write_allowedBoolSet 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
compactBoolOptional
fullscreenBoolOptional
peerUsername, chat ID, Update, Message or InputPeerIf 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
appInputBotAppThe app obtained by invoking messages.getBotApp as specified in the direct Mini App deep link docs.Yes
start_paramstringIf the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param.Optional
theme_paramsDataJSONTheme parameters »Optional
platformstringShort name of the application; 0-64 English letters, digits, and underscoresOptional

Return type: WebViewResult

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();

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