class AppDelegate: UIResponder, UIApplicationDelegate, MobileRTCAuthDelegate {
var window: UIWindow?
let kSDKAppKey = "SDK key here"
let kSDKAppSecret = "SDK secret here"
let kSDKDomain = "www.biztiz.com"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// Step 1: Set SDK Domain and Enable log (You may disable the log feature in release version).
MobileRTC.shared().setMobileRTCDomain(kSDKDomain)
// Step 2: Get Auth Service
let authService = MobileRTC.shared().getAuthService()
print("MobileRTC Version: \(MobileRTC.shared().mobileRTCVersion())")
if authService != nil {
// Step 3: Setup Auth Service
authService?.delegate = self
authService?.clientKey = kSDKAppKey
authService?.clientSecret = kSDKAppSecret
// Step 4: Call authentication function to initialize SDK
authService?.sdkAuth()
}
return true
}
func onMobileRTCAuthReturn(_ returnValue: MobileRTCAuthError) {
print(“onMobileRTCAuthReturn (returnValue)”)
if returnValue != MobileRTCAuthError_Success {
let message = String(format: NSLocalizedString("SDK authentication failed, error code: %zd", comment: ""))
print("\(message)")
}
}
}
This is what my appDelegate looks like. It simply crashes on launch without any errors in console.