Flutter: zoom sdk android failed to initialize

Hello, I’m trying to implement zoom sdk version 5.16.10.17706 and always failed to initialize the SDK on android

Here’s I create jwtToken on flutter

    String token;
    var timeStamp = today;
    final exp = timeStamp.add(Duration(minutes: 30)).millisecondsSinceEpoch;

    /* Sign */ {
      // Create a json web token
      final jwt = JWT(
        {
          "appKey": Env.ZOOM_KEY,
          "iat": timeStamp.millisecondsSinceEpoch,
          "exp": exp,
          "tokenExp": exp
        },
        header: {
          "alg": "HS256",
          "typ": "JWT"
        }
        // issuer: 'https://github.com/jonasroussel/dart_jsonwebtoken',
      );

      // Sign it
      token = jwt.sign(SecretKey(Env.ZOOM_SECRET));

      printWrapped('Signed token: $token\n');
    }

and here’s is the code to init the SDK on native android

private fun initSDK(call: MethodCall, result : MethodChannel.Result) {
        Utils.setLog(this, "initSDK: ${call.arguments}")

        val params = ZoomSDKInitParams().apply {
            domain = "zoom.us"
            enableLog = true
            jwtToken = call.argument("jwt") ?: ""
//            appKey = call.argument("zoomKey") ?: ""
//            appSecret = call.argument("zoomSecret") ?: ""
        }

        sdk.initialize(this, ZoomSDKListener(), params)
        result.success(true)
        return
    }

but on the zoom SDK listener always failed to initialize SDK errorCode: 1 , internalErrorCode:0.

edit: I used

dart_jsonwebtoken: ^2.8.0

Thank you for posting in the Zoo Developer Forum. I recommend referencing the Sample Auth Meeting app and comparing it with your implementation. You can use this app to generate a token and hardcode it to ensure it functions as expected. From there, you can compare the signed token with yours. Here is the sample app for reference:

I’m sorry it’s confusing, the previous version I used is 5.13.5.11583 and in this version, I only used app key and secret key to initialize ZoomSDK, but recently the initialize has success but the user cannot join the meeting.

Status from MeetingServiceListener is connecting and then disconnected, so when I asked the support they said to upgrade the version of Zoom that I used.

So I tried to upgrade to 5.16.10.17706 but it doesn’t use the app key and secret key anymore to init the SDK instead using JWTtoken and I tried to generate using a plugin in Flutter and yes it failed.

From your recommendation, it means I have to generate it from the server right?

@fauzi.nur21,

Correct, you could generate the JWT from the server side and hardcode it to determine if you can join successfully. This approach will assist in identifying any potential issues with your current implementation.

Ok, I will try it.

But why did they remove appKey and appSecret on the latest version?

I’m also facing the same problem for the week with the same zoom sdk version. Have you tried to create the JWT from the server side? … and if so, will it work correctly for you?

I’m tried to create a access token from the postman(Server to server OAuth method) and hardcoded with flutter code. I’m facing the same issue errorCode: 1 , internalErrorCode: 0.

Is JWT has deprecated ?
Should we needed to use server to server OAuth for authentication before inialize zoom sdk?

@mjthirutj13 yes it work with JWT token from the server side. Big thanks to @donte.zoom

Seems in the document, they have mentioned like JWT token method has deprecated whereas can we use it? …

I tried online generated JWT token and hardcoded to initialize app, but the error comes like errorCode: 1 , internalErrorCode: 124

Code :

val sdk = ZoomSDK.getInstance()

override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
    super.configureFlutterEngine(flutterEngine)
    MethodChannel(
            flutterEngine.dartExecutor.binaryMessenger,
            CHANNEL
    ).setMethodCallHandler { call, result ->
        if (call.method == "initializeZoomSDK") {
            JWT_TOKEN = call.argument<String>("JWToken");
            println("TOKEN  $JWT_TOKEN")
            initialiseSDK()
        } else if (call.method == "joinMeeting") {
            MEETINGID = call.argument<String>("meetingID");
            PASSCODE = call.argument<String>("meetingPasscode");
            joinMeeting()
        } else if (call.method == "startMeeting") {
            MEETINGID = call.argument<String>("meetingID");
            startMeeting()
        } else {
            result.notImplemented()
        }
    }
}

private fun initialiseSDK() {
    println("calling native method")
    val initParams = ZoomSDKInitParams()
    initParams.jwtToken = JWT_TOKEN
    initParams.enableLog = true
    initParams.domain = "zoom.us"
    sdk.initialize(context, this, initParams)
}

I think your generated JWT is wrong, have you tried to create it from the server side and follow the documentation mentioned by @donte.zoom

Sure, I’ll try with server side and coming back to here. Thanks @fauzi.nur21

Replying because I’m interested in getting Zoom into my flutter app.

Hey, @bens1 and @mjthirutj13 ,

To clarify, Zoom does not offer an official Flutter Meeting SDK. They do provide a Video SDK for Flutter, but not specifically for meetings. Perhaps @fauzi.nur21 can share more about the Flutter Meeting SDK he used.