MadelineProto/docs/TD_docs/methods/setNetworkType.md

23 lines
1.2 KiB
Markdown
Raw Normal View History

2017-08-25 15:05:53 +02:00
---
title: setNetworkType
2017-12-21 21:08:25 +01:00
description: Sets current network type. Can be called before authorization. Call to this method forces reopening of all network connections mitigating delay in switching between different networks, so it should be called whenever network is changed even network type remains the same. -Network type is used to check if library can use network at all and for collecting detailed network data usage statistics
2017-08-25 15:05:53 +02:00
---
## Method: setNetworkType
[Back to methods index](index.md)
YOU CANNOT USE THIS METHOD IN MADELINEPROTO
2017-12-21 21:08:25 +01:00
Sets current network type. Can be called before authorization. Call to this method forces reopening of all network connections mitigating delay in switching between different networks, so it should be called whenever network is changed even network type remains the same. -Network type is used to check if library can use network at all and for collecting detailed network data usage statistics
2017-08-25 15:05:53 +02:00
### Params:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|
|type|[NetworkType](../types/NetworkType.md) | Yes|New network type, defaults to networkTypeNone|
### Return type: [Ok](../types/Ok.md)