Reinit JWT token

Description
How can I reinit SDK with a new JWT value?

Which iOS Meeting SDK version?
zoom-sdk-ios-5.7.1.645

To Reproduce(If applicable)
The SDK works fine when we initially set a JWT in the app. We would like to set a new JWT when user’s join 2nd meeting or so on. In other words, every meeting that user’s join should have it’s own JWT. It’s our business requirement. How can we do that?

The following is the code that I have:
MobileRTCSDKInitContext *context = [[MobileRTCSDKInitContext alloc] init];
context.domain = kSDKDomain;
context.enableLog = YES;
context.appGroupId = kAppGroupId;
context.locale = MobileRTC_ZoomLocale_Default;

    BOOL sdkInitSuc = [[MobileRTC sharedRTC] initialize:context];
    
    if (sdkInitSuc) {
        MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];
            if (authService) {
                [authService setJwtToken: _jwtToken];
                authService.delegate = self;
                [authService sdkAuth];
            }
   }

Smartphone (please complete the following information):

  • Device: iPhone 13 pro
  • OS: iOS 15.3.1

Hi @harpreetsoftdatainc,

Can you please elaborate on why you are looking to init the SDK a second time? If your current auth session hasn’t yet expired, there is no need to init the SDK for each meeting you’re looking to join. You can listen for the auth expiring through the onMobileRTCAuthExpired callback.

Thanks!

Hi. Thanks for the response. It’s good to know that we can listen for the auth expiring event. How can we set a new JWT to the SDK in this case? Could you share code with me?

The JWT will be send to customer via SMS and when customer taps on it, the JWT will be read by mobile app (using deep links) and they can join the meeting. The JWT will be set for a short live and every customer will be provided with a new JWT. In order words, we will be providing the customer with a JWT and we don’t have any API endpoint expose so that mobile app can get the JWT from. It’s a business requirement that we are trying to implement in the app.

So question is - how can we reinit SDK with a new JWT every time they join a meeting?

Hi @harpreetsoftdatainc,

Even in your use case, you will only need to auth the SDK again if the SDK sends the callback mentioned in my previous reply. There should not be any major differences in how you auth the SDK if it is necessary to do it again.

Thanks!

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