Skip to main content
Print

With iOS mobile app in Swift

Overview

The Cuvo Feedback 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 feedback system into your app, enhancing user interactions and providing valuable customer support.

Integrating CuVo Feedback 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, feedback 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 CuvoAgent.framework.zip. Unzip/Decompress the downloaded zip file to get the integration framework folder.

To integrate the Cuvo Feedback Agent into your iOS application, follow the steps below.

1. Drag and drop the CuvoAgent.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 CuvoAgent 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.

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

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.

let cuvoFeedbackManager = Manager()

cuvoFeedbackManager.updateAgentDetail(keyWindow: self.window!,
                          isDarkTheme: false,
                          isCustomButton: true,
                          ordId: "<YOUR_ORG_ID>",
                          prodId: "<YOUR_ACCOUNT_ID>",
                          productVersion: "<YOUR_ACCOUNT_VERSION>",
                          endPoint: "https://apiprod.cuvo.io",
                          apiKey: "<YOUR_API_KEY>")
{ success in
    if success {
        // The API call was successful
        print("API call was successful")
    } else {
        // The API call failed
        print("API call failed")
    }
}

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 feedback button is displayed.  You are now enabled to submit feedback and report issues from with the app.

Additional Methods

Hiding the Feedback button

You can hide a feedback button in a particular view controller, then use

let cuvoFeedbackManager = Manager()

cuvoFeedbackManager.hideFeedbackButton()

Showing the Feedback button

If you want to show the feedback button which is hidden, then use

let cuvoFeedbackManager = Manager()

cuvoFeedbackManager.showFeedbackButton()

Opening Feedback Screen 

You can open the feedback screen using your own button or from the hamburger menu, then use

let cuvoFeedbackManager = Manager()

cuvoFeedbackManager.openFeedbackView()

Note:  If you are having issues running the app in the simulator after integrating the CuvoAgent, 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.

Table of Contents