How to Join a zoom meeting as a host from android client sdk, where as the meeting already created from zoom api

Description
From the backend we have already created a zoom meeting, but how can i join in to that meeting as a host from the Android Client.

The below is the response am getting from the backend team from create meeting api. By using below response how can I join the meeting as a host from the android client sdk.

{“uuid":“some_uuid”,“id”:random_id,“host_id”:“host_id”,“host_email”:example@gmail.com”,“topic”:“Topic Name”,“type”:2,“status”:“waiting”,“start_time”:“2020-11-10T04:30:00Z”,“duration”:30,“timezone”:“America/Los_Angeles”,“created_at”:“2020-11-09T12:48:30Z”,“start_url”:“Error - Zoom”}}

Which version?
Knowing the version can help us to identify your issue faster.

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Hi @mallikarjunreddy751, thanks for the post.

There are a couple of options that will allow you to start a meeting as the host with the information available in the response.

First, you could just allow the Zoom app to handle this entirely by opening the link (provided in the start_url field in the response) on an Android device with the Zoom app installed. This would require no implementation of the SDK within your own app.

The second option is parsing the start_url for the ZAK, meeting number, and password. After obtaining these, you can use the SDK to start the meeting as an API user. Documentation on this route can be found here.

Let me know if either of these solutions do not work for your use case and I will be happy to provide further assistance.

Thanks!

Hi Jon,

Thanks for the reply.
Actually am following the second option in order to open the meeting with in my application. And am parsing the start_url and using ZAK, meeting number and password. It is working absolutely fine for the first time to join as a HOST.

But when am trying to join the same meeting after 2 hours it is asking for a password(dialog window to enter) to start the meeting and am not able to join as a host instead it seems to be assuming me as a attendee(client).

Why is this wearied behavior, Could you help me out on this issue please.

Hi @mallikarjunreddy751, thanks for the additional information.

Could you please provide a code snippet showing how you are starting the meeting through the SDK? Additionally, can you verify that you are not logged in as another user? This can be checked through the SDK by calling ZoomSDK.getInstance().isLoggedIn();.

Thanks!

Below is the code snippet which am using.

public int startMeetingWithMeetingId(Context context, String meetingNo,String userId,String zak) {
boolean isLoggedIn = ZoomSDK.getInstance().isLoggedIn();
Log.d(“IsLoggedIn”, "IsLoggedIn: "+ isLoggedIn);
int ret = -1;
ZoomSDK mZoomSDK = ZoomSDK.getInstance();
MeetingService meetingService = mZoomSDK.getMeetingService();
if(meetingService == null) {
return ret;
}

    StartMeetingOptions opts = ZoomMeetingUIHelper.getStartMeetingOptions();

    StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
    params.userId = userId; //TODO: Enable for proper working functionality...
    params.userType = MeetingService.USER_TYPE_API_USER;
    params.displayName = "User Name";
    params.zoomAccessToken = zak;
    params.meetingNo = meetingNo;
    ret = meetingService.startMeetingWithParams(context, params, opts);
    Log.i("Start Meeting As Host", "startMeetingWithNumber, ret=" + ret);
    return ret;
}

Also i have checked this method: ZoomSDK.getInstance().isLoggedIn(); and am getting false with this method return type.

Hi @mallikarjunreddy751, thanks for providing that.

It looks like the code you have provided shouldn’t be causing any issues. This narrows the issue down to the ZAK itself. If you are using the same token more than once, you must account for the expiration window. By default, the token will expire exactly two hours after you receive it. If you are hardcoding your zak for testing purposes, this just means that you will need to request a new one every two hours.

Thanks!

Hi Team,

How can I join a zoom meeting which is already created by zoom api (from our backend) as a host as well as customer(Joinee) by using zoom android client SDK with out providing app secret while initialization the android client.
If we try to comment and run the app with out app secret we are getting exception like below.

NullPointerException: appSecret cannot be null

We are able to start the zoom meeting if we provide app secret while initializing the zoom SDK, but due to the security reasons we don’t want to provide app secret with in the app.
Is there any other possibilities to initialize the SDK with out app secret to joint the meeting as a host & Joinee aswell.

One more question here…
Is there any official flutter plugin available for flutter framework, as we are implementing this feature in native and then connecting through some platform channels.
I have seen the flutter plugin from the below url
https://pub.dev/packages/zoom is this official one ?

Hi @mallikarjunreddy751,

How can I join a zoom meeting which is already created by zoom api (from our backend) as a host as well as customer(Joinee) by using zoom android client SDK with out providing app secret while initialization the android client.

It is not possible to use the Android SDK without providing your SDK key and secret values. This is by design and will always be required.

due to the security reasons we don’t want to provide app secret with in the app.

This is definitely recommended. Including a hard-coded credential in your app is absolutely a security risk. Instead, our recommended approach is to generate a JWT on your own servers as-needed. There are some other approaches (which could be found by searching) that are more secure than using a hard-coded value in your code, but less secure than generating a JWT on your own servers. Unfortunately I cannot provide guidance on these, as generating the JWT is the only approach we officially recommend.

Is there any official flutter plugin available for flutter framework, as we are implementing this feature in native and then connecting through some platform channels.

We have seen quite a few developers successfully integrate our Android and iOS SDKs into their Flutter projects, but as of today we do not yet provide support for Flutter directly. We will do our best to assist with your usages of the SDKs after you have them added to your project, but there is no guaranteed support for Flutter.

Thanks!

Hi Jon,

Thanks for getting back to us.

Currently we are generating JWT token from our own server as you mentioned above.
But when am trying to initialize the sdk by commenting the sdk key and secret and providing jwt token instead am unable to start / join the zoom session.

Please find the below code snippet we are currently trying to start the meeting with jwt token.

public void initializeSdk(Context context) {
         sdk = ZoomSDK.getInstance();
ZoomSDK.getInstance().getMeetingSettingsHelper().setCustomizedMeetingUIEnabled(true);
        ZoomSDKInitParams params = new ZoomSDKInitParams();
        params.jwtToken = "JWT Token from our Backend";
        params.domain = "zoom.us";
        params.enableLog = true;

        ZoomSDKInitializeListener listener = new ZoomSDKInitializeListener() {
            @Override
            public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {
                Toast.makeText(context, "Success", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onZoomAuthIdentityExpired() {
                Toast.makeText(context, "Failed to initialize Zoom SDK", 
                Toast.LENGTH_SHORT).show();
            }
        };
        sdk.initialize(context, listener, params);

    }
public int startMeeting(Context context, String meetingNo,String userId,String zak) {
        boolean isLoggedIn = ZoomSDK.getInstance().isLoggedIn(); // Here we are getting false
        Log.d("IsLoggedIn", "IsLoggedIn: "+ isLoggedIn);
        int ret = -1;

        // TODO: enable for local sdk instance
        ZoomSDK mZoomSDK = ZoomSDK.getInstance();
        MeetingService meetingService = mZoomSDK.getMeetingService();

        //TODO: enable for global sdk instance
//        MeetingService meetingService = sdk.getMeetingService();
//NOTE: For your Ref: Both local & global references for MeetingService instances are working fine, as we have tested with sdk key & secret key approach.(Please correct us is there any differences here).
        if(meetingService == null) {
            // NOTE:The pointer is comming to this clause when we initialize the sdk with jwt and starting the meeting. (But if we follow the initialization with sdk key & secret the pointer is not comming over here why ?).
            Log.d("Meeting Service", "It is null: ");
            return ret;
        }
        Log.d("Meeting Service", "NOt null: ");
        StartMeetingOptions opts = ZoomMeetingUIHelper.getStartMeetingOptions();

        StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();

        params.userId = "USER_ID"; // Based on this id we are able to start the meeting as host
        params.userType = MeetingService.USER_TYPE_API_USER;
        params.displayName = "User Name";
        params.zoomAccessToken = "ZAK"; // We are also getting this ZAK from our back-end
        params.meetingNo = "MEETING_NO"; // meetingNo
        ret = meetingService.startMeetingWithParams(context, params, opts);
        Log.i("Start Meeting As Host", "startMeetingWithNumber, ret=" + ret);
        return ret;
    }

Please let us know is there any mistake (or any parameters missing) in above code in order to start meeting with JWT token.

But if we initialize the SDK wiith sdk key and secret(with out jwt) it is working perfectly fine with the same code snippet, why it is happening. Could you provide any sample code to start / join zoom meeting with jwt token.

Hi @mallikarjunreddy751,

I’m not seeing anything immediately wrong with your implementation.

One problem that may arise is in your onZoomSDKInitializeResult callback. It is displaying a Toast with a “success” message regardless of what the errorCode param is. This may make it seem that you have successfully initialized the SDK when the callback indicates that it failed. I would recommend changing this to only display if the error code equals ZOOM_ERROR_SUCCESS, and logging the error code if it is any other value.

After taking this approach, you may find our error code documentation useful if you see an error returned in that callback.

Thanks!

Hi @jon.zoom

As per your suggestion i have checked the error code with ZOOM_ERROR_SUCCESS in onZoomSDKInitialization callback.

There it self am getting the error while initializing the SDK with error code 1 (i.e ZOOM_ERROR_INVALID_ARGUMENTS) what exactly the error belongs ?.

How can i fix this issue. Please provide some detailed notes on the error we are facing currently to fix the issue.
Note: We are trying to initialize the SDK with jwt token (not with sdk key & secret)

Thanks !.

Hi @mallikarjunreddy751,

This means there is something missing or incorrect when initializing the SDK. Can you please confirm that you are using the correct JWT structure noted here? Also, are you sure that you are using your SDK key/secret when generating the JWT?

Thanks!

Hi @jon.zoom

Yes, am using the correct JWT structure as per the doc with jwt.io site temporarily for testing. Also am using sdk key & secret to generate jwt token.

Below procedure we are following currently for testing purpose:

Header:

{
   "alg": "HS256",
   "typ": "JWT"
}

Payload:

{
  "appKey": "SDK_KEY",
  "iat": 1626286981,
  "exp": 1626329184,
  "tokenExp": 3600
}

And Finally HMAC256 Signature with SDK_SECRET (as per the jwt.io)

HMACSHA256(
	base64UrlEncode(header) + "." +
	base64UrlEncode(payload),
	SDK_SECRET
)

Please let me know is there any other things i need to include for proper JWT token generation.

We have try an another way of getting jwt token from market place, as shown in the below attachment(view here under JWT section we have jwt token & customization for the jwt expiration time).

Please provide a possible solution ASAP.

Thanks!

Hi @mallikarjunreddy751,

Please try setting the tokenExp to a valid value at least 3600 greater than the iat field.

Thanks!

Hi @jon.zoom

Thanks again for getting back to us.

Yes, I have tried to setting up the tokenExp to a proper value as you suggested.

Now am facing the different issue (error code) like ZOOM_ERROR_NETWORK_UNAVAILABLE i.e error code 3.

Note: I have checked my network connection & it is connect to proper network.

Modified Payload As per your suggition:
{
“appKey”: “APP_KEY”,
“iat”: 1626387867,
“exp”: 1626560665,
“tokenExp”: 1626474265
}

Please let us know is there any other things we are missing?

Hi @mallikarjunreddy751,

This error means that the SDK has not been able to communicate with the Zoom backend from your device. Are you able to reproduce this error using the SDK’s sample app?

Thanks!

Hi @jon.zoom

Yes, am using SDK’s sample app only to test the zoom initialization and using the version v5.2.41727.0928.

Hi @mallikarjunreddy751,

Thanks for confirming. Can you try updating to the latest version of the SDK and see if you are still receiving this error?

Thanks!

Hi @jon.zoom

I tried the latest zoom sdk version v5.5.1.1319 and still facing the same error.

Below is the out put am getting in console.

I/InitAuthSDKHelper: onZoomSDKInitializeResult, errorCode=5, internalErrorCode=124
D/CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10462; state: ENABLED
D/Toast: show: caller = us.zoom.sdksample.ui.InitAuthSDKActivity.onZoomSDKInitializeResult:143
I/Toast: show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1 isDexDualMode=false
I/Toast: show: isActivityContext = true

Hi @mallikarjunreddy751,

The error code 5 you are seeing in the logs is not actually a network error. When initializing the SDK, this error code indicates that there was an incorrect token provided. Can you please double-check that you are using the key/secret values associated with an SDK app on your account, and not a JWT app? You can check this by looking at the Type column when selecting your app in the Marketplace before retrieving your credentials.

Thanks!