Skip to main content

account.unregisterDevice

Deletes a device by its token, stops sending PUSH-notifications to it.

func (c *Client) AccountUnregisterDevice(ctx context.Context, request *AccountUnregisterDeviceRequest) (bool, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AccountUnregisterDevice(ctx, &tg.AccountUnregisterDeviceRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
TokenTypeintyesDevice token type, see PUSH updates for the possible values.
TokenstringyesDevice token, see PUSH updates for the possible values.
OtherUIDs[]int64yesList of user identifiers of other users currently using the client

Returns

bool

Possible errors

CodeTypeDescription
400TOKEN_INVALIDThe provided token is invalid.

References