Working with the Zoho GC SDK for iOS - Online Help | Zoho Desk

Working with the Zoho GC SDK for iOS

Mobile applications have proven to be a significant component of business with the advent of smartphones. Businesses offer a range of services through their mobile phone applications for better customer engagement. To improve users' interest in apps, developers endeavor to include outstanding customer service features.

The Guided Conversations (GC) mobile SDK for iOS helps developers build a conversational self-service platform to achieve the best customer service. GC replaces human interactions with built-in conversations. It directs customers to appropriate solutions according to their responses during conversations.

Setting up the SDK  

     You need to integrate the GC widget within your iOS app to create and register the add-on in Zoho Desk.

      1.      In Zoho Desk, go to Setup GENERAL Guided Conversations.
 
      2.      In the Setup pane, on the left, under General, click Guided ConversationsClick GC Widgets.
                  The GC Widgets pane will appear. It displays the created widgets.
                  See more: how to create the widget.
 
      3.      Click the Share button () on the right side of the widget you want to embed.
                     A Share Options window will appear.

      4.      Click MOBILE SDK.


A new section called Code Snippet will appear. This section displays the following:

  • Org ID - Specifies the unique ID of the organization.

  • Widget ID - Specifies the unique ID of the selected widget.

  • Domain - Specifies the unique URL of your organization. 

These details are essential for initializing the ASAP SDK in your app.  

Integrating the SDK within the iOS app 

After setting up the SDK, you need to integrate the ZohoGCSDK within your iOS app.
This can be integrated by the following two ways:

(i) Automated integration using CocoaPods: This method involves the use of CocoaPods (dependency manager) to add third-party frameworks and libraries to Xcode projects.
 
(ii) Manual integration:  Integrate ZohoGCSDK manually without any dependency manager

Automated integration using CocoaPods:

To integrate the SDK into your app, you must create a Podfile for your project in order to use CocoaPods. Follow the below instructions to generate a Podfile if you haven't already.
      1.      In Terminal, navigate to the top-level folder of your project (the folder with the xcodeproj file).
      2.      Execute the $ pod init command.
      3.      Open the Podfile in Xcode by executing the open -a Xcode Podfile command.

                  The content appears as follows:

# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'My Sample App' do
end 

      4.      If you use Swift, uncomment the use_frameworks!  line.

To install the SDK in your project, you must include the ZohoGCSDK to the Podfile.
Follow these instructions to accomplish this.

 

      1.      Include the SDK of your choice in the Podfile. Include the following code in the do block of the Podfile to integrate the ZohoGCSDK.  


target 'My Sample App' do 
	pod  'ZohoGCSDK'
	end  

      2.      Save the Podfile.

      3.      Execute the $ pod install command in Terminal.

Before installation of CocoaPods, the file will be opened as xcodeproj. After installation, close the xcodeproj file and open the xcworkspace file.

 

Learn more about CocoaPods: how to install CocoaPods and  how to use CocoaPods

Manual integration:

To integrate ZohoGCSDK, perform the following steps:

 

      1.      Download the SDK of ZohoGCSDK.

      2.      Decompress the downloaded zip file with .XCFramework extension. 

      3.      Drag and drop the respective framework file to your Xcode project bundle's Frameworks, Libraries, and Embedded content section.

The ZohoGCSDK is compatible with iOS 11 and all later versions.
Note: If you want to integrate the ZohoGCSDK, make sure to add the NSPhotoLibraryUsageDescription, NSCameraUsageDescription, and NSMicrophoneUsageDescription keys in the info.plist file of your app.
Warning: Failing to add these keys to the info.plist file will result in app crash at the time of launching the app or when the relevant view controller is presented and Appstore validation may fail.

Displaying Guided Conversations  

The following keys are essential to call the methods for displaying the conversation AI in your app.

  • orgId

  • widgetId

  • domain

The values of these keys appear under the Code Snippet section on the setup page of the ASAP add-on in Zoho Desk.

 

For all method calls related to the Guided Conversations, you must include the following import statement.

SHOW BOT:

 

Swift

import ZohoGCSDK

Objective-C

  @import ZohoGCSDK;

The following methods display the Guided Conversations.


Swift

 ZohoGC.show(orgId: <#T##String#>, 
widgetId: <#T##String#>, domain: <#T##String#>) 

Objective-C

[ZohoGC showWithOrgId:<#(NSString * _Nonnull)#> 
widgetId:<#(NSString * _Nonnull)#> domain:<#(NSString * _Nonnull)#>]

Session Variables:   

These variables are dynamically retrieved during the conversation. These variables are org-specific and accessible across flows.

Learn more: session variable

 

You can perform the following actions with the session variable:

Set Session Variable:   

ZohoGC.setSessionVariables(sessionVariables: <#T##[String : String]#>)

Update Session Variable:

ZohoGC.updateSessionVariables(sessionVariables: <#T##[String : String]#>)

Customizing the theme:  

Predefined themes: The SDK UI comes with two predefined themes: white and black.
The following methods help you apply these themes.



                       ZDTHEMETYPE.DARK                                                    ZDTHEMETYPE.WHITE   

            .                                   

        
   


Methods for applying the white theme (Default)

Swift

 ZDThemeManager.setTheme(type: .white)

Objective-C

[ZDThemeManager setTheme:ZDThemeTypeWhite];

Methods for applying the black theme

Swift

ZDThemeManager.setTheme(type: .dark)

Objective-C

 [ZDThemeManager setTheme:ZDThemeTypeDark];
iOS 13 provides users with the option to set a dark or light theme throughout the system. For iOS 13 and above, you can set the system theme in the GC add-on. In such cases, the add-on will be in the same theme as the rest of the OS.

Swift

 ZDThemeManager.setTheme(type: .system)

Objective-C

[ZDThemeManager setTheme:ZDThemeTypeSystem];

Note:
- ZDThemeType.system is available only for iOS 13 and above.
- By default, the system theme will be applied for iOS 13 and above, and the light theme will be applied for earlier versions.

Customized themes: You can customize the default light and dark themes to make the SDK look more like your application.

 

To update the default light theme,

Swift

 ZDThemeManager.updateTheme(theme:<#ZDThemeProtocol#>)

Objective-C

 [ZDThemeManager updateThemeWithTheme:<#ZDThemeProtocol#>];

 

To update the default dark theme,

Swift

 ZDThemeManager.updateDarkTheme(theme: <#ZDThemeProtocol#>)

Objective-C

 [ZDThemeManager updateDarkThemeWithTheme:<#ZDThemeProtocol#>];

 

ZDThemeProtocol provides a list of properties, such as primaryTextColor and navigationBarTextColor, for additional color customization. All properties in the protocol are optional. You can create any class conforming to this protocol, implement one or more properties, and pass an object of that class to the updateTheme or updateDarkTheme method. The colors you set in the class will override the default theme.

 

Note: Updating the SDK's theme is different from setting a theme type. At any point of time, the SDK will be in a dark or light theme, based on the theme type you have set.

Clearing local data:  

Use the following method to delete any local data that has been saved inside the SDK, such as databases and files:

 

Swift

 ZohoGC.clearData()

Objective-C

 [ZohoGC clearData];

SDK logging:  

By default, logs are disabled for the SDK. To get the debug logs printed in logcat, enable the logs by the following method:


Swift

 import ZohoGCSDK 
    ...
    ZohoGC.enableLog(isLogEnabled: <#T##Bool#>)

Objective-C
@import ZohoGCSDK;
     ... 
     [ZohoGC enableLogWithIsLogEnabled:<#(BOOL)#>];



Release Notes

1.2.1

-Enhanced visuals with a refreshed appearance.
-Resolved bugs and optimized performance for a smoother user experience.
-Expanded customization options with the introduction of new colors.​​
​-ZDThemeKit module has been removed. Importing ZDThemeKit for ZDThemeManager is not required henceforth.

​1.1

-The location component and URL buttons have been added.

    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION









                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Building the Guided Conversations flow

                                                                                                                A good practice to follow before setting out to build a conversation flow is to prepare a hand-written or digital outline of the conversation or process to ensure all the necessary inputs and outputs are in the right place in a sequential order. ...
                                                                                                              • FAQs: Basics of Guided Conversations

                                                                                                                What is Guided Conversations? Guided Conversations, also known as GC in Zoho Desk is a way to implement your self-service strategy. It is a GUI (Graphical User Interface) based, low-code, self-service platform aimed to deliver great customer ...
                                                                                                              • FAQs: Creating Guided Conversations Flow

                                                                                                                What is the difference between Response Blocks and Action Blocks? Response Blocks and Action Blocks are the two fundamental categories of blocks in the GC flow builder. All the blocks are grouped under Response Blocks and Action Blocks. The former is ...
                                                                                                              • Configuring Webhook Block in Guided Conversations

                                                                                                                The webhook block is one of the three action blocks available in Guided Conversations. This block enables the conversation flow to interact with Zoho Desk processes or other Zoho services or third-party services. The webhook block uses APIs from Zoho ...
                                                                                                              • Introducing GC iOS SDK

                                                                                                                With the advent of smartphones, mobile applications have proven to be a significant business component. Businesses offer various services through their mobile phone applications to improve customer engagement, and developers include top-notch ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources