account.registerDevice #

Register device to receive PUSH notifications

Layer 223

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
no_mutedflags.0?trueAvoid receiving (silent and invisible background) notifications. Useful to save battery.
token_typeintDevice token type, see PUSH updates for the possible values.
tokenstringDevice token, see PUSH updates for the possible values.
app_sandboxBoolIf (boolTrue) is transmitted, a sandbox-certificate will be used during transmission.
secretbytesFor FCM and APNS VoIP, optional encryption key used to encrypt push notifications
other_uidsVector<long>List of user identifiers of other users currently using the client

Result #

Bool

Only users can use this method #

Possible errors #

CodeTypeDescription
400TOKEN_EMPTYThe specified token is empty.
400TOKEN_INVALIDThe provided token is invalid.
400TOKEN_TYPE_INVALIDThe specified token type is invalid.
400WEBPUSH_AUTH_INVALIDThe specified web push authentication secret is invalid.
400WEBPUSH_KEY_INVALIDThe specified web push elliptic curve Diffie-Hellman public key is invalid.
400WEBPUSH_TOKEN_INVALIDThe specified web push token is invalid.

Handling PUSH-notifications #

How to subscribe to and handle PUSH notifications

boolTrue #

The constructor can be interpreted as a booleantrue value.