1. Launch Gluedin Dashboard as a Guest user on Button click:
call GluedIn Root tab view controller and initiate the navigation flow which is best fit for your application. We show sample code below:
@IBAction func launchGluedinTabAsGuest(_ sender: Any) {
GluedIn.shared.initSdk {
let gluedinTab:UITabBarController = GluedIn.shared.rootTabController() ?? UITabBarController()
self.navigationController?.pushViewController(gluedinTab, animated: true)
} failure: { error, code in
print(error)
}
}
2. Launch GluedIn as a authenticated user:
call to register the user method with multiple parameter and call the root controller once you get the call back from register user method. We show the sample code below:
@IBAction func registerUserAndlaunchGluedin(_ sender: Any) {
GluedIn.shared.initSdk {
GluedIn.shared.quickLaunch(email: "amitch184@gmail.com",
password: "123456789",
firebaseToken: "",
deviceId: "1234",
deviceType: "ios",
fullName: "amit",
autoCreate: true,
termConditionAccepted: true) { [weak self] vw in
guard let weakSelf = self else { return }
weakSelf.navigationController?.pushViewController(vw ?? UIViewController(), animated: true)
} failure: { err,arg in
print(err)
print(arg)
}
} failure: { err,arg in
print(err)
print(arg)
}
}