-
Notifications
You must be signed in to change notification settings - Fork 21
setNetworkType
Sahri Riza Umami edited this page Jun 23, 2018
·
4 revisions
Sets the current network type.
Can be called before authorization.
Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks, so it should be called whenever the network is changed, even if the network type remains the same.
Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics.
setNetworkType(type, callback, data)
Field | Type | Description |
---|---|---|
type |
string | The new network type: None , Mobile , MobileRoaming , WiFi and Other . By default, networkTypeOther . |
-
Sets the current network type to "Mobile".
setNetworkType('Mobile')
Response:
{ ["@type"] = "ok" }
Frequently Asked Questions
The Functions
- getAuthorizationState
- setTdlibParameters
- checkDatabaseEncryptionKey
- setAuthenticationPhoneNumber
- resendAuthenticationCode
- checkAuthenticationCode
- checkAuthenticationPassword
- requestAuthenticationPasswordRecovery
- recoverAuthenticationPassword
- checkAuthenticationBotToken
- logOut
- close
- destroy
- setDatabaseEncryptionKey
- getPasswordState
- setPassword
- getRecoveryEmailAddress
- setRecoveryEmailAddress
- requestPasswordRecovery
- recoverPassword
- createTemporaryPassword
- getTemporaryPasswordState
- processDcUpdate
- getMe
- getUser
- getUserFullInfo
- getBasicGroup
- getBasicGroupFullInfo
- getSupergroup
- getSupergroupFullInfo
- getSecretChat
- getChat
- getMessage
- getRepliedMessage
- getChatPinnedMessage
- getMessages
- getFile
- getRemoteFile
- getChats
- searchPublicChat
- searchPublicChats
- searchChats
- searchChatsOnServer
- getTopChats
- removeTopChat
- addRecentlyFoundChat
- removeRecentlyFoundChat
- clearRecentlyFoundChats
- checkChatUsername
- getCreatedPublicChats
- getGroupsInCommon
- getChatHistory
- deleteChatHistory
- searchChatMessages
- searchMessages
- searchSecretMessages
- searchCallMessages
- searchChatRecentLocationMessages
- getActiveLiveLocationMessages
- getChatMessageByDate
- getPublicMessageLink
- sendMessage
- sendMessageAlbum
- sendBotStartMessage
- sendInlineQueryResultMessage
- forwardMessages
- sendChatSetTtlMessage
- sendChatScreenshotTakenNotification
- deleteMessages
- deleteChatMessagesFromUser
- editMessageText
- editMessageLiveLocation
- editMessageCaption
- editMessageReplyMarkup
- editInlineMessageText
- editInlineMessageLiveLocation
- editInlineMessageCaption
- editInlineMessageReplyMarkup
- getTextEntities
- parseTextEntities
- getFileMimeType
- getFileExtension
- getInlineQueryResults
- answerInlineQuery
- getCallbackQueryAnswer
- answerCallbackQuery
- answerShippingQuery
- answerPreCheckoutQuery
- setGameScore
- setInlineGameScore
- getGameHighScores
- getInlineGameHighScores
- deleteChatReplyMarkup
- sendChatAction
- openChat
- closeChat
- viewMessages
- openMessageContent
- readAllChatMentions
- createPrivateChat
- createBasicGroupChat
- createSupergroupChat
- createSecretChat
- createNewBasicGroupChat
- createNewSupergroupChat
- createNewSecretChat
- upgradeBasicGroupChatToSupergroupChat
- setChatTitle
- setChatPhoto
- setChatDraftMessage
- toggleChatIsPinned
- setChatClientData
- addChatMember
- addChatMembers
- setChatMemberStatus
- getChatMember
- searchChatMembers
- getChatAdministrators
- setPinnedChats
- downloadFile
- cancelDownloadFile
- uploadFile
- cancelUploadFile
- setFileGenerationProgress
- finishFileGeneration
- deleteFile
- generateChatInviteLink
- checkChatInviteLink
- joinChatByInviteLink
- createCall
- acceptCall
- discardCall
- sendCallRating
- sendCallDebugInformation
- blockUser
- unblockUser
- getBlockedUsers
- importContacts
- searchContacts
- removeContacts
- getImportedContactCount
- changeImportedContacts
- clearImportedContacts
- getUserProfilePhotos
- getStickers
- searchStickers
- getInstalledStickerSets
- getArchivedStickerSets
- getTrendingStickerSets
- getAttachedStickerSets
- getStickerSet
- searchStickerSet
- searchInstalledStickerSets
- searchStickerSets
- changeStickerSet
- viewTrendingStickerSets
- reorderInstalledStickerSets
- getRecentStickers
- addRecentSticker
- removeRecentSticker
- clearRecentStickers
- getFavoriteStickers
- addFavoriteSticker
- removeFavoriteSticker
- getStickerEmojis
- getSavedAnimations
- addSavedAnimation
- removeSavedAnimation
- getRecentInlineBots
- searchHashtags
- removeRecentHashtag
- getWebPagePreview
- getWebPageInstantView
- getNotificationSettings
- setNotificationSettings
- setNotificationSettings
- resetAllNotificationSettings
- setProfilePhoto
- deleteProfilePhoto
- setName
- setBio
- setUsername
- changePhoneNumber
- resendChangePhoneNumberCode
- checkChangePhoneNumberCode
- getActiveSessions
- terminateSession
- terminateAllOtherSessions
- getConnectedWebsites
- disconnectWebsite
- disconnectAllWebsites
- toggleBasicGroupAdministrators
- setSupergroupUsername
- setSupergroupStickerSet
- toggleSupergroupInvites
- toggleSupergroupSignMessages
- toggleSupergroupIsAllHistoryAvailable
- setSupergroupDescription
- pinSupergroupMessage
- unpinSupergroupMessage
- reportSupergroupSpam
- getSupergroupMembers
- deleteSupergroup
- closeSecretChat
- getChatEventLog
- getPaymentForm
- validateOrderInfo
- sendPaymentForm
- getPaymentReceipt
- getSavedOrderInfo
- deleteSavedOrderInfo
- deleteSavedCredentials
- getSupportUser
- getWallpapers
- registerDevice
- getRecentlyVisitedTMeUrls
- setUserPrivacySettingRules
- getUserPrivacySettingRules
- getOption
- setOption
- setAccountTtl
- getAccountTtl
- deleteAccount
- getChatReportSpamState
- changeChatReportSpamState
- reportChat
- getStorageStatistics
- getStorageStatisticsFast
- optimizeStorage
- setNetworkType
- getNetworkStatistics
- addNetworkStatistics
- resetNetworkStatistics
- setBotUpdatesStatus
- uploadStickerFile
- createNewStickerSet
- addStickerToSet
- setStickerPositionInSet
- removeStickerFromSet
- sendCustomRequest
- answerCustomQuery
- setAlarm
- getCountryCode
- getInviteText
- getTermsOfService
- setProxy
- getProxy
- testCallEmpty
- testCallString
- testCallBytes
- testCallVectorInt
- testCallVectorIntObject
- testCallVectorString
- testCallVectorStringObject
- testSquareInt
- testNetwork
- testGetDifference
- testUseUpdate
- testUseError
- sendText
- sendAnimation
- sendAudio
- sendDocument
- sendPhoto
- sendSticker
- sendVideo
- sendVideoNote
- sendVoiceNote
- sendLocation
- sendVenue
- sendContact
- sendGame
- sendInvoice
- sendForwarded