Description
I am using ZoomSDKAuthService in the mac app to log in users. The login request actually happens on an iPhone connected via bonjour, mac app responds with login status returned in this function
`func onZoomSDKLogin(_ loginStatus: ZoomSDKLoginStatus, failReason reason: String)`
This is my code for login function and delegate callback:
func login(
_ userName: String,
password: String,
rememberMe: Bool,
completion: @escaping LoginCompletion
) {
loginCompletion = completion
// sdk.getAuthService()?.logout() //This is even magical ;)
print("ZoomAuthService: login: start time: \(Date())")
sdk.getAuthService().delegate = self
sdk.getAuthService().login(userName, password: password, rememberMe: rememberMe)
}
func onZoomSDKLogin(_ loginStatus: ZoomSDKLoginStatus, failReason reason: String) {
print("ZoomAuthService:onZoomSDKLogin(_ loginStatus: \(loginStatus), failReason reason: \(reason)")
guard loginStatus == ZoomSDKLoginStatus_Success,
let user = sdkAuthService?.getAccountInfo()?.zoomUser else {
guard loginStatus == ZoomSDKLoginStatus_Failed else { return }
print("ZoomAuthService: login failed: end time: \(Date())")
loginCompletion?(
Result.failure(
NSError(
domain: "ZoomAuthService",
code: Int(loginStatus.rawValue),
userInfo: ["message": reason]
)
)
)
return
}
print("ZoomAuthService: login successfule: end time: \(Date())")
loginCompletion?(Result.success(user))
}
I am facing a couple of issues related to the onZoomSDKLogin
callback.
- It doesn’t get called if SDK did autologin and the user has already logged in once. If I call the SDK login function again for the same credentials,
onZoomSDKLogin
never gets called. - If I uncomment the logout line before the login, So basically perform a logout before every login. I do receive
onZoomSDKLogin
callbacks most of the time but sometimes it takes up to 40 seconds.
In the cases where it is taking more time login fails for valid credentials.
I am attaching some logs for my tests to show you the time difference between the callbacks. You can search for the logs for print statements from the above code. You can also find the print statements from onZoomSDKLogout
. I have an assumption that login and logout calls are conflicting with each other hence the variation in response time. Good luck with that!
But I would like to know the reason for #1, I don’t understand why it should not send me an onZoomSDKLogin
callback for every login call.
Is there any way to attach text files or code to this blog? You can find the logs on this gist.
ZoomSDKAuthError
Which version?
Tested with these versions:
v5.2.41751.1026
v5.2.41735.0929