Last active
December 16, 2021 12:50
-
-
Save raphaelguye/b797bd8da69c76fc6537f88706c38c54 to your computer and use it in GitHub Desktop.
AppDelegate for Citrix MAM sdk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import OSLog | |
| import UIKit | |
| @main | |
| class AppDelegate: UIResponder, UIApplicationDelegate, CTXMAMCoreSdkDelegate { | |
| // MARK: Internal | |
| func application( | |
| _ application: UIApplication, | |
| didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) | |
| -> Bool | |
| { | |
| self.initializeCtxMam() | |
| return true | |
| } | |
| func initializeCtxMam() { | |
| CTXMAMCore.setDelegate(self) | |
| CTXMAMCore.initializeSDKs { nilOrError in | |
| if nilOrError != nil{ | |
| self.logger.error("Error initializing SDKs -> \(nilOrError.debugDescription)") | |
| } else { | |
| self.logger.notice("SDKs initialized and ready for use.") | |
| } | |
| } | |
| } | |
| func sdksInitializedAndReady(_ online: Bool) { | |
| if online { | |
| logger.notice("SDK initialized and ready. User is online") | |
| } else { | |
| logger.warning("SDK initialized and ready. User is NOT online") | |
| } | |
| } | |
| // MARK: Private | |
| private var logger = Logger(subsystem: "ch.bundle.id", category: "App") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment