Method: account.registerDevice
Register device to receive PUSH notifications
Parameters:
Name | Type | Description | Required |
---|---|---|---|
no_muted | Bool | Avoid receiving (silent and invisible background) notifications. Useful to save battery. | Optional |
token_type | int | Device token type, see PUSH updates for the possible values. | Optional |
token | string | Device token, see PUSH updates for the possible values. | Optional |
app_sandbox | Bool | If (boolTrue) is transmitted, a sandbox-certificate will be used during transmission. | Yes |
secret | bytes | For FCM and APNS VoIP, optional encryption key used to encrypt push notifications | Yes |
other_uids | Array of long | List of user identifiers of other users currently using the client | Yes |
Return type: Bool
Can userbots use this method: YES
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], );