App crashed when the initialization was done a second time

Hi guys,

I installed the SDK on my app, so in the first place I added the initialize code on my app component like the demo, I created a instant meeting successfully and invited a friend to test it, everything worked like expected until I clicked the end button, the app was reloaded and the initialization was done again and it got stuck so my app showed a blank screen indefinitively, not exception shown. I changed the initialization code to other custom component so when I end the meeting the app realoads and go back to home screen like I expected but if I try to go to this component again I get a exception:

Wait................................

V/<------- ZoomCordovaPlugin ---------->: onZoomSDKLoginResult result =====0
W/cr_AwContents: Application attempted to call on a destroyed WebView
java.lang.Throwable
at org.chromium.android_webview.AwContents.a(PG:378)
at org.chromium.android_webview.AwContents.a(PG:707)
at com.android.webview.chromium.WebViewChromium.evaluateJavaScript(PG:288)
at android.webkit.WebView.evaluateJavascript(WebView.java:977)
at com.getcapacitor.cordova.MockCordovaWebViewImpl$CapacitorEvalBridgeMode$1.run(MockCordovaWebViewImpl.java:80)
at android.app.Activity.runOnUiThread(Activity.java:5815)
at com.getcapacitor.cordova.MockCordovaWebViewImpl$CapacitorEvalBridgeMode.onNativeToJsMessageAvailable(MockCordovaWebViewImpl.java:76)
at org.apache.cordova.NativeToJsMessageQueue.enqueueMessage(NativeToJsMessageQueue.java:249)
at org.apache.cordova.NativeToJsMessageQueue.addPluginResult(NativeToJsMessageQueue.java:238)
at com.getcapacitor.cordova.MockCordovaWebViewImpl.sendPluginResult(MockCordovaWebViewImpl.java:253)
at org.apache.cordova.CallbackContext.sendPluginResult(CallbackContext.java:61)
at cordova.plugin.zoom.Zoom.onZoomSDKLoginResult(Zoom.java:749)
at us.zoom.sdk.ZoomSDK.onSDKLoginReturn(ZoomSDK.java:844)
at us.zoom.sdk.ZoomSDK.access$100(ZoomSDK.java:49)
at us.zoom.sdk.ZoomSDK$2.onPTAppEvent(ZoomSDK.java:107)
at com.zipow.videobox.ptapp.PTUI.dispatchPTAppEventImpl(PTUI.java:769)
at com.zipow.videobox.ptapp.PTUI.dispatchPTAppEvent(PTUI.java:707)
at com.zipow.videobox.mainboard.Mainboard.heartBeat4SingleProcessImpl(Native Method)
at com.zipow.videobox.mainboard.Mainboard.heartBeatForSDK(Mainboard.java:999)
at com.zipow.videobox.ptapp.PTApp.dispatchIdleMessage(PTApp.java:341)
at com.zipow.videobox.VideoBoxApplication$5.run(VideoBoxApplication.java:1202)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:7007)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

can anyone help me?

Hi kevin.camplone,

Thanks for using Zoom SDK. If you have successfully initialized the SDK, you do not need to initialize several times. Please try only to initialize the SDK once.

Thanks!

Hi carson! Thanks for your response, i initialize once in my app component, but when i click the end meeting button the app is reloaded so the initialization code is executed again. Its weird.

Hi again,

Let me explain myself again, the initialization code is in my app.component.ts so every time the app is closed or reloaded it got executed. that’s the problem. I don’t know why but when the user end/quit the meeting, the app is reloaded so the app.component.ts is called again.

I fixed it adding this code in Zoom.java:

if (!this.mZoomSDK.isInitialized()) {
this.initialize(appKey, appSecret, callbackContext);
}

I think this ionic sdk should have the method isInitialized()

thanks!

Hi kevin.camplone,

Thanks for the reply and the info. I was not able to reproduce the second initialization on my end, I only experience the initialization once, however, I totally agree that enhancement you are suggesting. I will forward this info to the engineering team.

Thanks!