Skip to content

Instantly share code, notes, and snippets.

@raphaelguye
Last active December 16, 2021 12:50
Show Gist options
  • Select an option

  • Save raphaelguye/b797bd8da69c76fc6537f88706c38c54 to your computer and use it in GitHub Desktop.

Select an option

Save raphaelguye/b797bd8da69c76fc6537f88706c38c54 to your computer and use it in GitHub Desktop.
AppDelegate for Citrix MAM sdk
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