Our company is releasing an application that works with ZoomMeeting,
We have recently updated the ZoomSDK (v5.16.10.17706), and the following error occurs.
Failed to initialize Zoom SDK, Error: 5, internalErrorCode=124
The timing of this error is not constant and occurs at various times.
When this occurs, the user cannot participate in ZoomMeeting, and restarting the application several times will improve the situation.
Internally, we believe that this is caused by a failure in the initialization of the Zoom SDK, but we have not found the cause in the implementation.
Please see attached the source of the initialization part of the Zoom SDK.
Create JWT with io.jsonwebtoken
AuthConstants.kt
val SDK_JWTTOKEN: String
get() {
try {
val key = Keys.hmacShaKeyFor(BuildConfig.ZOOM_SDK_SECRET.toByteArray())
val now = Date()
val jws = Jwts.builder()
.header().add("alg", "HS256").and()
.header().add("typ", "JWT").and()
.issuedAt(now)
.expiration(Date(now.time + 1000 * 3600))
.signWith(key)
//.claim("sdkKey", BuildConfig.ZOOM_SDK_KEY)
.claim("appKey", BuildConfig.ZOOM_SDK_KEY)
.claim("tokenExp", Date(now.time + 1000 * 3600).time / 1000)
.compact();
return jws
} catch(ex: Exception) {
}
return ""
}
Initialize SDK using created JWT
InitAuthSDKHelper.kt
fun initSDK(context: Context?, callback: InitAuthSDKCallback?) {
if (!mZoomSDK.isInitialized) {
val jwtToken = AuthConstants.SDK_JWTTOKEN
Timber.d("TOKEN:%s", jwtToken)
mInitAuthSDKCallback = callback
val initParams = ZoomSDKInitParams()
initParams.jwtToken = jwtToken
initParams.enableLog = true
initParams.logSize = 50
initParams.domain = AuthConstants.WEB_DOMAIN
//initParams.appKey = AuthConstants.SDK_KEY
//initParams.appSecret = AuthConstants.SDK_SECRET
initParams.videoRawDataMemoryMode =
ZoomSDKRawDataMemoryMode.ZoomSDKRawDataMemoryModeStack
GlobalScope.launch(Dispatchers.Main) {
mZoomSDK.initialize(context, this@InitAuthSDKHelper, initParams)
}
}
}