About this task
For iOS native apps, you must import the JSONStore
iOS framework into your Xcode project.You can obtain the JSONStore
feature in two ways:
- You can import the JSONStore framework manually or with CocoaPods.
For more information, see Setting up the Xcode project for iOS manually.
-
To use CocoaPods:
- You must have CocoaPods, the dependency manager for Xcode projects
installed in your development environment. For more information, see
the "Getting Started" guide for CocoaPods installation.
- Your application must be set up to use CocoaPods. For more information,
see Using CocoaPods.
- You must have an existing Podfile. If one
does not exist, create one by using the pod init command.
For more information, see Using CocoaPods.
- Create a Podfile file or edit an existing
one.
- Create a new file named Podfile by using
the pod init command.
- Open the Podfile file that is in the root
directory of the project with a text editor.
- Add the following lines and save the file:
pod 'IBMMobileFirstPlatformFoundationJSONStore'
Note: The
above syntax imports assumes you are using the latest version of the
IBMMobileFirstPlatformFoundation.
If you are are not using the latest version of
MobileFirst,
you need to indicate the version. For example, for importing the latest
pod for
8.0.0
IBMMobileFirstPlatformFoundation the
line would look like this:
pod 'IBMMobileFirstPlatformFoundationJSONStore', '~> 8.0.0'
- Open Terminal and navigate to the location
of the Podfile file.
- Verify that the Xcode project is closed.
- Type pod install to run the pod
install command.
This command installs the JSONStore Framework
for IBM MobileFirst Platform Foundation,
called the IBMMobileFirstPlatformFoundationJSONStore.framework component,
and integrates it with the mobile application Xcode project.
- You must import the JSONStore.h header file
in your code to use the JSONStore API. For Objective C add #import
<IBMMobileFirstPlatformFoundationJSONStore/IBMMobileFirstPlatformFoundationJSONStore.h>.
For Swift, add import IBMMobileFirstPlatformFoundationJSONStore.
For more information about creating native MobileFirst iOS
applications, see Developing native applications for iOS in Xcode.
For native Android applications, you must
add the files using gradle. For more information about creating native MobileFirst Android
applications, see Setting up Android Studio projects with Gradle.
After adding the JSONStore SDK, you can use the
classes inside the com.worklight.jsonstore.api package
to use JSONStore.
For Cordova applications,
you must add the cordova-plugin-mfp-jsonstore plug-in
to your MobileFirst Cordova
app. For more information see Adding MobileFirst features to an existing Cordova app.