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 Mashup SDK for iOS app development in Pega 7.2.1

Updated on July 26, 2018

The Mashup SDK extends the functionality of a custom third-party app. It consists of a library that, when included in a custom third-party app, provides access to at least one screen in which a Pega 7 Platform app (or its part) is embedded in a web view. You can set up the Mashup SDK in the Xcode development environment so that its API can be used to develop native iOS apps.

Prerequisites

The native iOS app that uses the Mashup SDK must be developed by using the following resources:

  • Objective-C programming language
  • Xcode 7.2 or later to create apps on iOS 8.x and 9.x.

Make sure that you have completed the following tasks:

  • Read the Mashup SDK overview article
  • Downloaded and installed CocoaPods 0.38.2 from the CocoaPods website
  • Have experience developing iOS apps
  • Downloaded the MashupDemo application that is distributed in the same package as the Mashup SDK

Adding the Mashup SDK to Xcode (Objective-C project)

To add the Mashup SDK to Xcode for an Objective-C project:

  1. Create an Objective-C project or open an existing project in Xcode.
  2. From the terminal, go to the main project directory and enter pod init.
  3. Open the Podfile that is created.
  4. In the main target, add the following code:
    pod 'CocoaLumberjack', '2.2.0' 
    pod 'ZXingObjC', '3.1.0' 
    pod 'PMBase', :path => 'path to module base' # example '../ProductModules/PMBase' 
    pod 'PMBarcodeScanner', :path => 'path to barcode scanner module' # example '../ProductModules/PMBarcodeScanner' 
    pod 'PMPRPCAuthentication', :path => 'path to PRPCAuthentication module' # path example '../ProductModules/PMPRPCAuthentication' 
    pod 'PMPRPCSnapStart', :path => 'path to PRPCSnapStart module' # path example '../MashupModules/PMPRPCSnapStart'
  5. Save the changes.
  6. From the command line, install pods by entering pod install.
  7. Open a new *.xcworkspace.
  8. Close the project in the other windows.
  9. Edit the AppDelegate.h file:
    1. Add the import statement:
      #import <PMBase/PMApplicationDelegate.h>
    2. Set PMApplicationDelegate as a super class, changing the @interface line to:
      @interface AppDelegate : PMApplicationDelegate <UIApplicationDelegate>
    3. To extend the methods from AppDelegate, invoke its counterpart method from the parent class, for example:
      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
        if (![super application:application didFinishLaunchingWithOptions:launchOptions]) { 
            return NO; 
        } 
        // add more code here 
        return YES; 
      }

Adding the Mashup SDK to Xcode (Swift project)

To add the Mashup SDK to Xcode for a Swift project:

  1. Create a Swift project or open an existing project in Xcode.
  2. From the terminal, enter the main project directory and enter pod init.
  3. Open the Podfile that is created.
  4. In the main target, add the following code:
    use_frameworks! 
    pod 'CocoaLumberjack', '2.2.0' 
    pod 'PMBase', :path => '../ProductModules/PMBase' 
    pod 'PMBarcodeScanner', :path => '../ProductModules/PMBarcodeScanner' 
    pod 'PMPRPCAuthentication', :path => '../ProductModules/PMPRPCAuthentication' 
    pod 'PMPRPCSnapStart', :path => '../MashupModules/PMPRPCSnapStart'
    The use_frameworks! option is required; without it, Cocoapods cannot generate an Xcode workspace with a Swift project.
  5. Save the changes.
  6. From the command line, install pods by entering pod install.
  7. Open a new *.xcworkspace.
  8. Close the project in the other windows.

Verifying the Mashup SDK configuration

To verify that the Mashup SDK is correctly configured in your Objective-C Xcode project, examine the Mashup SDK Demo app that is included in the distribution package that you received. To test the custom modules feature, you can add the four example pod modules that are in the Examples folder of the distribution package into your application.

Tags

Pega Platform 7.2.1 Pega Mobile Mashup Mobile Pega Express Consumer Services Consumer Services Manufacturing Financial Services Consumer Services Communications and Media Government Healthcare and Life Sciences Healthcare and Life Sciences Insurance

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