Get Started with RingCentral Engage Digital iOS SDK
We’re excited to announce RingCentral Engage Digital! Today I wanted to share my experience with RingCentral Engage Digitals iOS development with you. Three topics will be covered: what it is, how to install the Engage Digital SDK to your own iOS project, and how to add Engage Digitals chat interface to your app.
What is Engage Digital
Engage Digital focuses on delivering the next generation of customer service. It enables digital customer engagement through a unique platform. It allows you to step into your customers’ world and engage their way: connect with your customers wherever they are online and enjoy the numerous benefits of an omni-digital platform. Messages are collected from all channels to increase customer satisfaction, improve agent productivity, and overall generate significantly higher revenue.
Engage Digital has the following features:
- Aggregate messages from all digital channels.
- Allocate incoming messages automatically with AI.
- Digital conversations unified on a single platform.
- Optimize strategy and improve KPIs with comprehensive analytics in real-time.
- Integrate your business tools on an open platform.
How to install Engage Digital iOS SDK
To install Engage Digital go to Dimelo-iOS on GitHub, it contains the most comprehensive information. Personally I recommend you install Engage Digital iOS SDK via CocoaPods. Just follow these steps:
Install CocoaPods.
If you’ve never used it before go to CocoaPods official website to get instructions about how to install it.
Create workspace file.
CocoaPods works with workspace instead of project. So first you need to create a workspace if you don’t have one for your project. Here’s how to do this in Xcode: select File -> New -> Workspace.
You can give the workspace any name, normally I name it the same as the *.xcodeproj file(with a different file extension). After the workspace file is created, you don’t need to add anything to it, just close it.
Add Engage Digital to Podfile.
If there isn’t a Podfile in your project, you can create one by pod init
. Then add Engage Digital withpod ‘Dimelo-iOS’, :git => ‘https://github.com/dimelo/Dimelo-iOS.git'
to Podfile. A minimal Podfile looks like this:
Download and install Engage Digital.
This steps is easy, just do: pod install
.
Use the RingCentral Engage SDK in your code.
Open the workspace file we created .
This step is very important, if you open the project file instead of the workspace file, it simply won’t work.
Try import Dimelo
(the name of the SDK) in your code, if it compiles without errors, congratulations, you did it!
If you run into any issues make sure to go to our developer forum for help.
How to add Engage Digital chat interface
Engage Digital iOS SDK provides a built-in UIViewController
instance with XIB file. So you don’t need to build a chat interface from scratch. What you need is to add Engage Digital’s interface to your own project. Different projects have different UI patterns, so there isn’t a one size fits all solution. Here are instructions on how to add the Engage Digital (once again, in your code it will be referred to as Dimelo) chat interface as a tab in a UITabBarController
:
// TabBarViewController.swiftimport UIKitimport Dimeloclass TabBarViewController: UITabBarController, DimeloDelegate {func dimeloDisplayChatViewController(_ dimelo: Dimelo!) { self.selectedIndex = self.tabBar.items!.count - 1}var dimelo: Dimelo?override func viewDidLoad() { super.viewDidLoad() // Suppose you have created viewController1, viewController2 & viewController3 here. dimelo = Dimelo(apiSecret: "apiSecret", domainName: "domainName", delegate: self) let chatViewController = dimelo!.chatViewController()! chatViewController.tabBarItem = UITabBarItem(title: "Chat", image: UIImage(named: "Chat"), selectedImage: UIImage(named: "ChatSelected")) self.viewControllers = [viewController1, viewController2, viewController3, chatViewController]}}
There are several things that need to be explained:
dimelo
must be declared outside of theviewDidLoad
function, otherwise it is a local variable and will probably have garbage collected.apiSecret
is from Engage Digital Messaging source. You create it as a source and you will find anapiSecret
inside it.domainName
parameter you don’t need to specify the whole domain name. Let’s say your Engage Digital admin address is `https://abc.engagement.dimelo.com`, then specifydomainName
asabc
.- There must be a
DimeloDelegate
instance which implementsdimeloDisplayChatViewController
method.
The chat UI look should now look like this:
Summary
We’ve introduced Engage digital and its features to you, gone through the process of adding Engage digital iOS SDK to your project and we also provided technical details about adding the Engage Digital chat interface.
For more awesome tutorials checkout our blog, or to learn more about the RingCentral Developers Program and start building cool integrations with voice, SMS, team messaging, meetings fax, and more — visit https://developers.ringcentral.com/
I also am currently developing an app — GrandTravel for iOS. You can reference its code and also if you have questions or suggestions, you can open GitHub issues there.
Thank you for reading!