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
| Name | Type | Required | Description |
|---|---|---|---|
TokenType | int | yes | Device token type, see PUSH updates for the possible values. |
Token | string | yes | Device token, see PUSH updates for the possible values. |
OtherUIDs | []int64 | yes | List of user identifiers of other users currently using the client |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | TOKEN_INVALID | The provided token is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.unregisterDevice#6a0d3206