# onMobileRTCAuthReturn method not invoking with jwt token on iOS

**URL:** <https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980>\
**Category:** iOS\
**Created:** [August 18, 2021, 5:18am UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980 "2021-08-18T05:18:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mallikarjunreddy751](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mallikarjunreddy751/32/18203_2.png) [@mallikarjunreddy751](https://devforum.zoom.us/u/mallikarjunreddy751)\
**Post date:** [August 18, 2021, 5:18am UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/1 "2021-08-18T05:18:00Z")

</div>

Hi John,

I am able to initialise the android sdk with jwt and able to start and join as a host , but in iOS i am not able to get callbacks invoked after initialise sdk i am using below code please correct me if i am worng

MobileRTCSDKInitContext \*context = [[MobileRTCSDKInitContext alloc] init];  
// The domain we will us is [zoom.us](http://zoom.us/)  
context.domain = @“[zoom.us](http://zoom.us/)”;  
// Turns on SDK logging. This is optional.  
context.enableLog = YES;

```auto
context.locale = MobileRTC_ZoomLocale_Default;

// Call initialize:(MobileRTCSDKInitContext *_Nonnull)context to create an instance of the Zoom SDK. Without initializing first, the SDK will not do anything. This call will return YES if the SDK was initialized successfully.
BOOL sdkInitSuc = [[MobileRTC sharedRTC] initialize:context];

// Check if initialization was successful. Obtain a MobileRTCAuthService, this is for supplying credentials to the SDK for authorization.
if (sdkInitSuc) {
    MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];

    if (authService) {
        // Supply the SDK with SDK Key and SDK Secret. This is required if a JWT is not supplied.
        // To use a JWT, replace these lines with authorizationService.jwtToken = yourJWTToken;

```

// authService.clientKey = sdkKey;  
// authService.clientSecret = sdkSecret;  
authService.jwtToken = @“my jwt token”;

```auto
        // Assign AppDelegate to be a MobileRTCAuthDelegate to listen for authorization callbacks.
        authService.delegate = self;
        

        // Call sdkAuth to perform authorization.
        [authService sdkAuth];
        
    }
}else{
    NSLog(@"failed initialse SDK");
    
}

```

below method is not invoked if I use jwt token but the same method is invoking if I include sdkKey and sdkSecret also the jwt token is working fine on android client but not in iOS

- ( void )onMobileRTCAuthReturn:(MobileRTCAuthError)returnValue

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [August 18, 2021, 8:07pm UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/2 "2021-08-18T20:07:45Z")

</div>

Hey @mallikarjunreddy751,

Thanks for using the dev forum!

You are using the same JWT for both iOS and Android, and it is working on Android but not iOS?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![mallikarjunreddy751](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mallikarjunreddy751/32/18203_2.png) [@mallikarjunreddy751](https://devforum.zoom.us/u/mallikarjunreddy751)\
**Post date:** [August 19, 2021, 4:23am UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/3 "2021-08-19T04:23:18Z")

</div>

Yes @Michael_Condon ,

The same JWT we are using for both iOS and Android, and it is working on Android but not iOS

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [August 19, 2021, 4:28pm UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/4 "2021-08-19T16:28:38Z")

</div>

Hey @mallikarjunreddy751,

Strange. How are you creating the JWT? Are you using a third party library?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![mallikarjunreddy751](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mallikarjunreddy751/32/18203_2.png) [@mallikarjunreddy751](https://devforum.zoom.us/u/mallikarjunreddy751)\
**Post date:** [August 24, 2021, 6:17am UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/5 "2021-08-24T06:17:21Z")

</div>

Hi @Michael_Condon ,  
we are generating the jwttoken from the backend itself, the same jwtToken is working for android but not for iOS please look into the above previous post we are following that code which we are mentioned

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [August 24, 2021, 7:44pm UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/6 "2021-08-24T19:44:21Z")

</div>

Hey @mallikarjunreddy751,

I see. Can you reproduce this issue one more time, then capture the SDK logs and send them to me via email at [DeveloperSupport@zoom.us](mailto:DeveloperSupport@zoom.us)? Please provide a link to this post in your email.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 24, 2021, 5:44am UTC](https://devforum.zoom.us/t/onmobilertcauthreturn-method-not-invoking-with-jwt-token-on-ios/55980/7 "2021-09-24T05:44:39Z")

</div>

Closed on September 24, 2021, 5:44am UTC

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