# New iOS SDK - getAuthService returns nil ( On SDK Authentication )

**URL:** <https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005>\
**Category:** iOS\
**Created:** [July 2, 2020, 10:19am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005 "2020-07-02T10:19:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiranileoapp](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@jiranileoapp](https://devforum.zoom.us/u/jiranileoapp)\
**Post date:** [July 2, 2020, 10:19am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005/1 "2020-07-02T10:19:09Z")

</div>

**Description**  
After upgrading to the latest SDK - 5.0, `getAuthService` returns `nil` hence causing the rest of the Auth. procedure to fail.

**Which version?**  
v5.0.24433.0616

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

1. Add the SDK into your iOS project
2. Try authenticating the SDK
3. Observe what’s returned on `MobileRTC.shared().getAuthService()`
4. See error

**Additional context**  
This started after upgrading to the latest SDK.  
Below is a sample code that worked but returning `nil` now

```auto
func authenticateSDK() {
    let zoomSDK = MobileRTC.shared()
    guard let authService = zoomSDK.getAuthService() else {
        print("DEBUG: Auth service is \(zoomSDK.getAuthService())")
        return
    }
    authService.delegate = self
    authService.clientKey = ZoomAPI.appKey
    authService.clientSecret = ZoomAPI.appSecret
    authService.sdkAuth()
  }

```

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 3, 2020, 7:43am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005/2 "2020-07-03T07:43:07Z")

</div>

Hi @jiranileoapp,

Has the SDK been successfully initialized like this in the demo app:[https://github.com/zoom/zoom-sdk-ios/blob/master/MobileRTCSample/MobileRTCSample/SDKPresenters/how\_to\_init\_auth\_sdk/how\_to\_init\_sdk/SDKInitPresenter.m#L13](https://github.com/zoom/zoom-sdk-ios/blob/master/MobileRTCSample/MobileRTCSample/SDKPresenters/how_to_init_auth_sdk/how_to_init_sdk/SDKInitPresenter.m#L13) before calling the authService?

Thanks!

---

<div class="post-metadata">

**Author:** ![jiranileoapp](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@jiranileoapp](https://devforum.zoom.us/u/jiranileoapp)\
**Post date:** [July 3, 2020, 7:58am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005/3 "2020-07-03T07:58:38Z")

</div>

Greetings @Carson_Chen,  
Thank you for your response.

No - The SDK fails to initialise,  
I swapped the old SDK with the new one ( v.5 ),

- Implement Change-log instructions ( Which does not instruct how to set the above values that are `nil` )

Would you please instruct me how to initialise the values above( Using Swift )? - They are returning ‘nil’

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 14, 2020, 5:56am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005/4 "2020-07-14T05:56:57Z")

</div>

Hi @jiranileoapp,

Thanks for the reply. Could you verify and see if you have correctly imported the `MobileRTC.framework` and `MobileRTCResources.bundle`?

You could initialize the SDK like the following:

```auto
let context = MobileRTCSDKInitContext();
 context.domain = "zoom.us"
 MobileRTC.shared().initialize(context);

```

Once the initialization is a success, then you could perform SDK auth.

Thanks!

---

<div class="post-metadata">

**Author:** ![hemant](https://avatars.discourse-cdn.com/v4/letter/h/cab0a1/32.png) [@hemant](https://devforum.zoom.us/u/hemant)\
**Post date:** [August 12, 2020, 8:37am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005/5 "2020-08-12T08:37:17Z")

</div>

My SDK is successfully initialized  
**initializeSuccessful======\>1**  
but I am still getting nil on  
[[MobileRTC sharedRTC] getAuthService]; in “SDKAuthPresenter” File.  
Can you please help?

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [August 14, 2020, 5:32am UTC](https://devforum.zoom.us/t/new-ios-sdk-getauthservice-returns-nil-on-sdk-authentication/23005/6 "2020-08-14T05:32:39Z")

</div>

Hi @hemant,

Thanks for using Zoom SDK. Are you getting this issue with the iOS SDK demo app([https://github.com/zoom/zoom-sdk-ios](https://github.com/zoom/zoom-sdk-ios))? Is this reproducible on the demo app? If so, could you provide the step to reproduce it?

Thanks!
