Unified SDK not working in iOS | Community
Skip to main content

Unified SDK not working in iOS

  • March 29, 2022
  • 7 replies
  • 0 views

André18

I have implemented the Unified SDK as instructed in the documentation and also on the sample app provided.

Initializing all parts seem to work fine since no error is thrown, and the view controller is built and presented successfully.

Init calls (keys are redacted):

ZendeskCoreSDK.Zendesk.initialize(appId: "", clientId: "", zendeskUrl: "")
SupportProvidersSDK.Support.initialize(withZendesk: ZendeskCoreSDK.Zendesk.instance)
AnswerBot.initialize(withZendesk: ZendeskCoreSDK.Zendesk.instance, support: SupportProvidersSDK.Support.instance!)
Chat.initialize(accountKey: "")

Build UI calls:

let answerBotEngine = try AnswerBotEngine.engine()
let supportEngine = try SupportEngine.engine()
let chatEngine = try ChatEngine.engine()
let sessionViewController = try Messaging.instance.buildUI(engines: [answerBotEngine, supportEngine, chatEngine], configs: [messagingConfiguration])

I have a valid flow saved, but it doesn't really load - not even the first item in the flow. Right off the bat, it says: "Uh-oh. Sorry, something's up. I can't answer questions right now."

Then it offers to leave a message or chat to an agent. If I choose "leave a message" it says "Something went wrong and I wasn't able to send your message. Please try again later."

What would be possible reasons for this?

7 replies

Eric27
  • April 13, 2022
Hey André,

In your buildUI method, do you have a catch block for error handling? If so what are the errors that are being output?

André18
  • Author
  • April 14, 2022

Hey Eric,

I do have a catch block around all throwing functions called to build the UI itself, and none throw errors.


Eric27
  • April 14, 2022
Hey André,

Very odd, what version of the SDK and dependencies are you running? Is this happening across multiple device types? 

support59
  • April 25, 2022

We are also facing a similar issue with the Android SDK integration.

The web works fine and iOS has not been tested yet.

I'm suspecting the issue may be caused by the incorrect retrieval/setting of the parameter values (i.e. appId, clientId, zendeskURL, accountKey).

Can you confirm whether this is done correctly from our end:

1. appId & clientId:

{zendeskURL}/chat/agent#account/api_&_sdks

2. accountKey: 

Top right dropdown > Check Connection > Account Key

SDK versions and depedencies used:

api group: 'com.zendesk', name: 'messaging', version: '5.2.3'

api group: 'com.zendesk', name: 'support', version: '5.0.8'

api group: 'com.zendesk', name: 'chat', version: '3.3.4'

 

Many thanks


Adam35
  • August 16, 2022

I'm having the same issue. @eric27 did you ever find a solution for André Santos's issue?


Eric27
  • August 17, 2022
Hey Adam,

Can you provide some more details about your issue? What SDK version are you running and with what engines? Some code snippets would be great!

Thanks!

Adam35
  • August 17, 2022

@eric27,

I ended up getting this resolved by updating our API Key for Chat. A previous developer was using the api key from the web widget script.