field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

TeraAppDelegate.swift (924B)


      1 import UIKit
      2 
      3 public final class TeraAppDelegate: NSObject, UIApplicationDelegate {
      4     override public init() {
      5         super.init()
      6     }
      7 
      8     public func application(
      9       _ application: UIApplication,
     10       didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil
     11     ) -> Bool {
     12         #if DEBUG
     13             if (try? TeraRemoteQualificationEnvironment.current()) != nil {
     14                 application.isIdleTimerDisabled = true
     15             }
     16         #endif
     17         return true
     18     }
     19 
     20     public func application(
     21       _: UIApplication,
     22       handleEventsForBackgroundURLSession identifier: String,
     23       completionHandler: @escaping () -> Void
     24     ) {
     25         let completion = TeraCompletionOnce(completionHandler)
     26         Task {
     27             await TeraBackgroundEventRouter.shared.handle(
     28               identifier: identifier,
     29               completion: completion
     30             )
     31         }
     32     }
     33 }