With iOS mobile app in Swift
Overview
The CuVo Chatbot Agent supports iOS versions ranging from iOS 11.0 to the most current version with Swift5 as the programming language used.
This integration document explains how to easily integrate the CuVo chatbot into your app, enhancing user interactions and providing valuable customer support.
Integrating CuVo Chabot Agent into Your iOS Application
After creating an account and configuring the chat agent, you will see the Integration steps section. Generate an API key, select Mobile for Platform and iOS Swift for Technology. Now you have the code snippet, chat library and integration instructions for integration with your swift app for iOS mobile.
Click the Download SDK button to download and save the CuVo agent library file. The file would be most likely be named CuvoChatAgent.framework.zip. Unzip/Decompress the downloaded zip file to get the integration framework folder.
To integrate the CuVo Chatbot Agent into your iOS application, follow the steps below.
1. Drag and drop the CuvoChatAgent.framework file to the project root directory on your xcode project.
2. Go to your projects target, in the General tab – Frameworks, Libraries and Embedded content section.
3. Ensure that the framework you imported is listed there and the Embed and sign option is selected.
4. Import the CuvoChatAgent into your app delegate or scene delegate file, depending on where your application’s window management and lifecycle are handled.
5. Add the following code to your project’s app delegate or scene delegate.

6. Copy the code snippet you see in your Integration Steps section and paste it in the didfinishlaunching delegate of your app. Your code snippet will look like the code shown below. The success key in completion handler lets you know the integration with chat agent is successful or not.

In the above example, we have added our prodID, product version, orgID, api’s endpoint, and api key. The code snippet you copy from the portal should have your appropriate product ID, product version, organization ID and API key already filled in.
Note: The above example image is just representative and the actual code snippet can differ from the image.
Note: If you want to use your own button in your application and don’t want to display the frameworks button, send the isCustomButton as false.
7. Build the project and run the application.
The chat icon is displayed. You are now enabled to converse with the bot to address any issues.

Hiding the Chat icon
You can hide a chat icon in a particular view controller by following the steps below.
1. Import the CuvoChatAgent in the class.
2. Add the below code into the class.

Showing the Chat icon
If you want to show the chat button which is hidden, then use
manager.showChatButton()
Opening Chat Screen
You can open the chat screen using your own button or from the hamburger menu by following the steps below.
1. Call the function like below to open the chat bot.
let manager = ManagerUpdate()
manager.openChatView()
or
manager.openChatView(vc: UIViewController)
If the parameter vc is passed then the chat view is served using vc, otherwise it is served using the top level controller.
Note: If you are having issues running the app in the simulator after integrating the CuvoChatAgent, you can try resolving it by adding arm64 in the Excluded architecture for any iOS simulator key. For more information, refer to the Adding Arm64 section.
Adding Arm64
The steps to add arm64 are simple as follows.
1. Open your project.
2. Navigate to Build Settings within your project settings.
3. Expand the Excluded Architectures section.
4. Add a new row.
5. Set the key to iOS simulator.
6. Add the value arm64.