MadelineProtoDocs/docs/API_docs/constructors/codeSettings.md

45 lines
1.8 KiB
Markdown
Raw Normal View History

2019-03-08 13:49:23 +01: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-03-08 13:49:23 +01: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-03-08 14:35:09 +01:00
2019-03-08 13:49:23 +01:00
### Attributes:
2019-03-08 14:35:09 +01:00
| 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-03-08 13:49:23 +01:00
### Type: [CodeSettings](../types/CodeSettings.md)
### Example:
```php
2019-08-15 20:25:16 +02:00
$codeSettings = ['_' => 'codeSettings', 'allow_flashcall' => Bool, 'current_number' => Bool, 'allow_app_hash' => Bool];
2019-03-08 13:49:23 +01:00
```
Or, if you're into Lua:
```lua
2019-08-15 20:25:16 +02:00
codeSettings={_='codeSettings', allow_flashcall=Bool, current_number=Bool, allow_app_hash=Bool}
2019-03-08 13:49:23 +01:00
```