MadelineProtoDocs/old_docs/API_docs_v104/constructors/codeSettings.md

45 lines
1.8 KiB
Markdown
Raw Normal View History

2019-08-15 20:25:16 +02:00
---
title: codeSettings
2019-12-27 17:48:04 +01:00
description: Settings used by telegram servers for sending the confirm code.
Example implementations: [telegram for android](https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java), [tdlib](https://github.com/tdlib/td/tree/master/td/telegram/SendCodeHelper.cpp).
2019-08-15 20:25:16 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Constructor: codeSettings
[Back to constructors index](index.md)
2019-12-27 17:48:04 +01:00
Settings used by telegram servers for sending the confirm code.
Example implementations: [telegram for android](https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java), [tdlib](https://github.com/tdlib/td/tree/master/td/telegram/SendCodeHelper.cpp).
2019-08-15 20:25:16 +02:00
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|
2019-12-27 17:48:04 +01:00
|allow\_flashcall|[Bool](../types/Bool.md) | Optional|Whether to allow phone verification via [phone calls](https://core.telegram.org/api/auth).|
|current\_number|[Bool](../types/Bool.md) | Optional|Pass true if the phone number is used on the current device. Ignored if allow\_flashcall is not set.|
|allow\_app\_hash|[Bool](../types/Bool.md) | Optional|If a token that will be included in eventually sent SMSs is required: required in newer versions of android, to use the [android SMS receiver APIs](https://developers.google.com/identity/sms-retriever/overview)|
2019-08-15 20:25:16 +02:00
### Type: [CodeSettings](../types/CodeSettings.md)
### Example:
```php
$codeSettings = ['_' => 'codeSettings', 'allow_flashcall' => Bool, 'current_number' => Bool, 'allow_app_hash' => Bool];
```
Or, if you're into Lua:
```lua
codeSettings={_='codeSettings', allow_flashcall=Bool, current_number=Bool, allow_app_hash=Bool}
```