From 941661bbc8a9324ca72ffc0c7a2a0c44db15a6bf Mon Sep 17 00:00:00 2001 From: Ali <> Date: Fri, 20 Dec 2019 11:29:56 +0400 Subject: [PATCH] Ask for cellular access on first start --- .../TelegramUI/TelegramUI/ApplicationContext.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/submodules/TelegramUI/TelegramUI/ApplicationContext.swift b/submodules/TelegramUI/TelegramUI/ApplicationContext.swift index b4475e127c..42ab9f51d8 100644 --- a/submodules/TelegramUI/TelegramUI/ApplicationContext.swift +++ b/submodules/TelegramUI/TelegramUI/ApplicationContext.swift @@ -58,6 +58,16 @@ final class UnauthorizedApplicationContext { return .never } }) + + DeviceAccess.authorizeAccess(to: .cellularData, presentationData: sharedContext.currentPresentationData.with { $0 }, present: { [weak self] c, a in + if let strongSelf = self { + (strongSelf.rootController.viewControllers.last as? ViewController)?.present(c, in: .window(.root)) + } + }, openSettings: { + sharedContext.applicationBindings.openSettings() + }, { result in + ApplicationSpecificNotice.setPermissionWarning(accountManager: sharedContext.accountManager, permission: .cellularData, value: 0) + }) } }