Link Search Menu Expand Document

Method: account.registerDevice

Back to methods index

Register device to receive PUSH notifications

Parameters:

NameTypeDescriptionRequired
no_mutedBoolAvoid receiving (silent and invisible background) notifications. Useful to save battery.Optional
token_typeintDevice token type, see PUSH updates for the possible values.Optional
tokenstringDevice token, see PUSH updates for the possible values.Optional
app_sandboxBoolIf (boolTrue) is transmitted, a sandbox-certificate will be used during transmission.Yes
secretbytesFor FCM and APNS VoIP, optional encryption key used to encrypt push notificationsYes
other_uidsArray of longList of user identifiers of other users currently using the clientYes

Return type: Bool

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

$Bool = $MadelineProto->account->registerDevice(no_muted: $Bool, token_type: $int, token: 'string', app_sandbox: $Bool, secret: 'bytes', other_uids: [$long, $long], );