macOS ZoomSDKAuthDelegate callback not called in swift

Description
I have working macOS sample in objective-c but I am trying to make it in swift, so for the initial test I am trying to check auth, but auth works fine for Objective-c application, but not working on this sample code

class ViewController: NSViewController, ZoomSDKAuthDelegate {
func onZoomSDKAuthReturn(_ returnValue: ZoomSDKAuthError) {
print(returnValue)
}

func onZoomAuthIdentityExpired() {
    print("onZoomAuthIdentityExpired")
}

var _authService = ZoomSDKAuthService()
var helper : ZMSDKAuthHelper?

override func viewDidLoad() {
    super.viewDidLoad()
    let params = ZoomSDKInitParams()
    params.needCustomizedUI = true
    params.teamIdentifier = nil
    let initError = ZoomSDK.shared()!.initSDK(with: params)
    print(initError)
    let sdk = ZoomSDK.shared()!
    sdk.zoomDomain = "zoom.us"
    _authService = ZoomSDK.shared()!.getAuthService()!
    _authService.delegate = self
    let content =  ZoomSDKAuthContext()
    content.jwtToken = "my token"

    let error = ZoomSDK.shared()!.getAuthService()!.sdkAuth(content)
    print(error)


}

}

To Reproduce(If applicable)
Steps to reproduce the behavior:
I tried running this above code providing my actual Auth Token but it shows me error as ZoomSDKError(rawValue: 3)

Hi @niravd, thanks for the post.

It appears that you are setting the delegate incorrectly. You are instantiating a ZoomSDKAuthService object instead of using the one provided by the SDK. Please use the instance obtained through the getAuthService method to set the delegate instead.

Thanks!

Hi @jon.zoom isn’t this the same what is written in the above code
I am using the instance of getAuthService method to set the delegate

_authService = ZoomSDK.shared()!.getAuthService()!
_authService.delegate = self

Hi @niravd,

My apologies for missing that line in your post. Are you using Swift and Objective-C in the same project, or are you reproducing this in two different projects? It is possible for improper setup of the SDK to cause issues, but if you are using both languages in the same project, it is unlikely that that is the issue.

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.