Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Setting up the Connect SDK for iOS app development

Updated on July 18, 2018

This article describes how to set up the Connect SDK in the Xcode development environment so that the API for the Connect SDK can be used in iOS apps that are being developed.

Prerequisites

Only apps running on iOS 9.x or later can use the Connect SDK. The iOS app that uses the Connect SDK must be developed by using either the Swift or Objective-C programming language.

Make sure that you have already done the following tasks:

  • Read the Connect SDK overview article.
  • Read the Connect SDK AppleDocs which describe the API.
  • Developed iOS apps:
    • In the Xcode (9.2 or later) integration development environment (IDE)
    • Using the Swift or Objective-C programming language
The users of the Pega® Platform mobile app that you are creating must have the PegaRULES:PegaAPI role assigned to them.

Add the Connect SDK to Xcode

You add the Connect SDK to Xcode as a framework. For more information, see Adding the Connect SDK as a framework.

To implement OAuth for access delegation, you must use setAuthenticationHeader() function.

Optional steps

After you configure the Connect SDK, you can also perform the following optional tasks.

Verify that the Connect SDK is configured

You can test that the Connect SDK has been correctly configured by adding the following code to the iOS app that you are creating. Refer to the following instructions.

Start using the Connect SDK

To start using the Connect SDK:

  1. Add the ConnectSDK framework import statement to your Swift source file:
    import ConnectSDK
  2. Initialize the Connect SDK. Remember to replace the <server URL> string with your Pega 7 Platform application instance URL:
    let urlString = "http://test.pega.com:8080/prweb/api/v1";
    ​guard let serverURL = URL(string: urlString) else {
      fatalError("Please set valid url for Pega API")
    ​}
    ​let pegaAPI = PMPegaApi(serverURL: serverURL)
  3. Authenticate by using the Connect SDK. Remember to replace the <user name> and <password> strings in the following code with your Pega Platform credentials:
    pegaAPI.authenticationService.logIn(user: "user", password: "rules") { error in
      // code goes here
    ​}

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us