+

Search Tips   |   Advanced Search

Copy files of native API applications for iOS

To use the MobileFirst native API for iOS in the native application, copy the library and the client property file of the native API application into the project of the native app for iOS.

You copy the files from MobileFirst Studio and then to add them to the native application project, you work in your development IDE (typically, Xcode).

In MobileFirst Studio:

  1. Select the WorklightAPI folder and the worklight.plist file of the native API application and copy them to a location we can access from the native iOS project.

In the project for the native app for iOS (for example, in Xcode IDE):

  1. Add the WorklightAPI folder and the worklight.plist file of the native API application to the project.

    1. In the Choose options for adding these files window, select Copy items into destination group's folder (if needed) and Create groups for any added folders.

  2. In the Build Phases tab, link the following frameworks and libraries to the project.

    • SystemConfiguration.framework

    • MobileCoreServices.framework

    • CoreData.framework

    • CoreLocation.framework

    • Security.framework

    • sqlcipher.framework

      The framework sqlcipher.framework might already be linked.

    • libstdc++.6.dylib

    • libz.dylib

  3. Select the project name and the target for the application.

  4. Click the Build Phases tab.

  5. In the Build Phases page, proceed as follows.

    1. Open the list in the Link Binary with Libraries section, and make sure that libWorklightStaticLibProjectNative.a is visible in the list.

    2. Open the list in the Copy Bundle Resources section and make sure the files from the resources folder are added to that section.

  6. Click the Build Settings tab.

  7. On the Build Settings page, proceed as follows.

    1. Click All (in the upper left corner) to show all settings.

    2. Add the following entry: $(SRCROOT)/WorklightAPI/include for HEADER_SEARCH_PATH

    3. In the Other Linker Flags field, enter the following value: -ObjC

    4. In the Deployment section, select a value for the iOS Deployment Target field that is greater than or equal to 5.0.


Parent topic: Develop native applications for iOS