Developer

Setting Up an Xcode Project

Use these instructions to set up a new project to use the SMPAgentryClientFramework, as well as to add the SMPAgentryClientFramework to an existing project.

Prerequisites

  • A Mac with a supported version of Xcode installed and ready to develop for iOS.

  • Expand the SMPAgentryClientFramework distribution into a directory. These instructions refer to a directory named SDK_INSTALL_HOME.

Context

The Samples/ directory includes a new project that is already setup.

Procedure

  1. Open Xcode and create a new project by selecting Start of the navigation path iOS Application Next navigation step Empty Application End of the navigation path.
  2. Set the iOS Deployment Target to 7.0 or above for your project.
  3. Add the SAP Mobile Platform Agentry Client Framework:
    1. Select the project, the main target, and, in Build Settings, search for "Framework Search Path".
    2. Double-click, and enter:

      SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/**

  4. Add the SAP Mobile Platform Agentry Client Framework Headers:
    1. Select the project, the main target, and, in Build Settings, search for "Header Search Path".
    2. Double-click, and enter:

      SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/SMPAgentryClient.framework/Headers/**

  5. Modify linker flags:
    1. Select the project, the main target, and, in Build Settings, search for "Other Linker Flags".
    2. Double-click, and enter:

      -ObjC -framework SMPAgentryClient

  6. Add the required dynamic libraries and frameworks:
    1. Select the project, the main target, and, in Build Phases, search for, and select the "Link With Dynamic Libraries section.
    2. Click the + button, and add the following:
      - `libc++.dylib`
      		- `libiconv.dylib`
      		- `libicucore.dylib`
      		- `libxml2.dylib`
      		- `AudioToolbox.framework`
      		- `AVFoundation.framework`
      		- `CFNetwork.framework`
      		- `CoreLocation.framework`
      		- `CoreMedia.framework`
      		- `CoreText.framework`
      		- `CoreVideo.framework`
      		- `QuartzCore.framework`
      		- `Security.framework`
      		- `CoreGraphics.framework`
      		- `Foundation.framework`
      		- `UIKit.framework`
      
  7. Remove stripping from the project settings:
    1. Select the project, the Xcode project, and, in Build Settings, search for "Strip Linked Product".
    2. Double-click, and select No.
  8. Add the resources bundle:
    1. In Xcode, select Start of the navigation path File Next navigation step Add Files to Project End of the navigation path.
    2. Browse to the SDK_INSTALL_HOME/SMPAgentryClientFramework/iOS/SMPAgentryClient.framework/Resources/SMPAgentryClientResource.bundle location, and add it.
  9. Modify the main.m file to launch the Agentry Client:
    1. Replace the app delegate class name with the string:

      @"SMPAgentryClientAppDelegate

    2. Replace the application class name with the string:

      @"SMPAgentryApplication

    3. At the end, the return statement should look like this:

      return UIApplicationMain(argc, argv, @"SMPAgentryApplication", @"SMPAgentryClientAppDelegate");

  10. Set up the app so that view controllers do not determine the style of the status bar.

    Modify Info.plist to include the following key: UIViewControllerBasedStatusBarAppearance set to `false`.

  11. Build and launch the project. You should see the default Agentry Client in the simulator or device.

    You can now start adding code for your custom adapters; and the Agentry Client will dynamically read them.