Build a Hello World App for iOS

Learning Objectives

After completing this unit, you’ll be able to:
  • Embed the Service SDK frameworks into your iOS project.
  • Wire up some basic Service SDK features to your iOS project.
  • Describe where to find more Service SDK resources.

Get Started with iOS

OK. So you’re convinced that the Embedded Service SDK is right for you. You’re excited about how this SDK can wire up some awesome Service Cloud features to your app. You’ve already prepared your org for use with the SDK. In this unit, we show you how quickly you can get this stuff working inside your existing iOS app for iPhone and iPad.



This unit assumes that you’re familiar with iOS development. We’re not going to teach you how to use Swift or how to get around the Xcode IDE. If you’re not familiar with these things, you can still scan the unit to get a feel for what it entails to use this SDK.

Create a Basic Project in Xcode

Now you’re ready to build a simple project. Start off by launching Xcode and creating a Single View Application. Use Xcode 9 or later.

Single View Application

For this example, let’s keep things savvy and use the Swift language.

Swift language

Next, download the Embedded Service SDK from the Service SDK download page.

Unzip the SDK and embed all the included framework files into your project.

Embed frameworks

If you prefer to use CocoaPods to install the SDK, or you want to know exactly which frameworks are required for your use case, check out the SDK installation instructions (see Resources).

One more bit of housekeeping before we can add our pretty button. We need to create an App Transport Security (ATS) exception for localhost to serve cached knowledge base articles. Open your project’s Info.plist file and add the following content.


Add a Help Button

Let’s add a help button to your main view controller.

Drag a button onto your view controller. Rename the button to something helpful, like: Service SDK Rocks!.

Snap-ins Rock!

Align the button to the other views so that it’s positioned correctly on all supported devices.

Now create an action method for the button in our view controller and name it buttonTapped.

Button action step 1

Button action step 2

Button action step 3

Wire Up Your Button

OK. Now let’s get to the coding! We’re going to hook into the Knowledge feature, but you can try any of the other features if you prefer.

First off, open your AppDelegate class and import the frameworks we need:

import ServiceCore
import ServiceKnowledge

Configure your SDK in the application(_:didFinishLaunchingWithOptions:) method:

// Create configuration object with init params
let config = SCSServiceConfiguration(
               community: URL(string: "")!,
               dataCategoryGroup: "Regions",
               rootDataCategory: "All")
// Pass configuration to shared instance
ServiceCloud.shared().serviceConfiguration = config

Be sure to replace the placeholder values with real values for your Experience Cloud site URL, data category group, and root data category. If you don’t, your app will be very sad when it doesn’t find any Knowledge content. For more detailed guidance, check out Cloud Setup for Knowledge in the Resources section.

So now let’s mosey on down to the ViewController class and make that button do more than just look pretty.

We need to import our frameworks in this file as well.

import ServiceCore
import ServiceKnowledge

Next, let’s launch the Knowledge interface right from that button handler we created earlier using the setInterfaceVisible method.

@IBAction func buttonTapped(_ sender: AnyObject) {
                                  animated: true,
                                  completion: nil)

And that’s that. Launch the app, tap our new button, and bask in your Knowledge glory.

Knowledge on iOS

Pretty cool, huh? From here, you can do all kinds of other things. You can add hero images for any categories or articles. You can rebrand the colors, along with UI text, fonts, and images that are used throughout the interface. Rest assured, working with Case Management or Chat is just as easy as working with Knowledge.

What’s Next?

What’s that you say? How do you get more info?

Well, you can start with the Embedded Service SDK for iOS Developer Guide. It contains more tutorials, more examples, and covers loads more topics. It gives you the info on all the major feature areas: Knowledge, Case Management, and Chat. You can also refer to the Reference Documentation for iOS for those nitty-gritty details about the API. Find links to these and other great tools in the Resource section.

Next we tackle how to create a similar app for Android.

Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • 1 in 4 land a new job
  • 50% receive a promotion or raise
  • 80% learn new technologies that boost their resume
  • 66% say it increases productivity
Source: Trailblazer Community Impact Survey 2019