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.

Connect SDK 7.4 migration guide for the iOS platform

Updated on September 12, 2019

Several changes were introduced in the new Pega® Mobile SDK 7.4 version which includes the Connect SDK. This article will help you migrate your application from an old version of the Connect SDK to the current version.

API changes

  • The PMPegaConfig class is not available.
  • You must change all code snippets that include PMPegaConfig and the previous version of PMPegaApi to: PMPegaApi(serverURL: URL) or PMPegaApi(serverURL: URL, urlSession: URLSession) setting serverURL on the PMPegaAPI object. Please note that PMPegaApi is not a singleton.
  • For the authentication header functionality, you can use the new setAuthenticationHeader(header: string) method.
  • The PMDataPage class is available in the Connect SDK. It is used to create a datapage instance instead of creating a map by using ([String: Any]).
  • You can register for push notifications by using a new method for the PMAuthentication class: func registerPushNotification(serverURL: URL, user: String, password: String, deviceToken: Data, completionHandler: @escaping (Error?) -> Void).

Code example of how to authenticate to Pega Platform with the Connect SDK for iOS is shown below:

let urlString = "http://sample.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)

You now logout from Pega Platform in the Connect SDK in the following way: PegaApi.shared.authenticationService.logout()

You can also set your own instance of the URLSession during the creation of a new PMPegaApi instance by using the following initializer function: PMPegaApi(serverURL: URL, urlSession: URLSession)

CocoaPods support

The previous versions of Connect SDK for iOS were based on CocoaPods and additional libraries. One of these libraries forced completionHandlers to always run on the main queue called DispatchQueue.main. You were required to do this in your code directly. This functionality was removed in the new Connect SDK version since you may use the Connect SDK with an application that does not contain a user interface or you may want to control what is executed from the main queue.

For the new Connect SDK version support, you must update all applications that were using an old version of Connect SDK to use DispatchQueue.main on all the user interface components.

To learn more about Xcode project configuration for the iOS platform, see Adding the Connect SDK as framework.

Tags

Pega Platform 7.3.1 Pega Mobile Mashup Mobile Pega Express

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