Set up the iOS development environment by downloading the required plugins and importing
the associated iOS libraries into the iOS development environment.
Prerequisites
Install the OData SDK on the Mac development machine.
Procedure
- Start Xcode and select Create a new Xcode project.
- Under iOS, select
Application.
- In the right pane, select Empty Application as the
project template and click Next.
- Set Project Options, then choose Next.
- Configure library dependecies either by using a .podspec file, or by copying
includes and libraries:
Option |
Description |
Configuring dependencies using a .podspec file |
- Copy the NativeMAF.podspec file installed with the iOS
SAP Mobile Platform SDK into the
/NativeSDK/MAFReuse/iOS/ directory of
your SAP Mobile Platform SDK installation.
- Create a new iOS project in Xcode then close Xcode.
- Navigate to the project directory in Terminal, and run
pod init.
- Copy this text into the generated Podfile to import all libraries:
##################################
platform :ios, "8.0"
target "<My Project Name>" do
inhibit_all_warnings!
pod 'NativeMAF', :path => "~/SAP/MobileSDK3/NativeSDK/MAFReuse/iOS/"
end
##################################
Tip If you do not want to import all libraries, you
can use subspecs for some libraries. To do so, copy the
NativeSDK.podspec file installed
with the iOS SAP Mobile Platform SDK into the
/NativeSDK/ directory of your
SAP Mobile Platform SDK installation. For
example to use only the ODataOnline library, copy this
text into the Podfile:
##################################
platform :ios, "8.0"
target "<My Project Name>" do
inhibit_all_warnings!
pod 'NativeSDK/ODataOnline', :path => "~/SAP/MobileSDK3/NativeSDK/"
end
##################################
The
following subspecs are supported: - NativeSDK/ODataOnline
- NativeSDK/MAFLogon
- NativeSDK/ODataOffline
- NativeSDK/Usage
- NativeSDK/HttpConversationManager
- NativeMAF/ODataAPI
- Modify the path to match the location of
/NativeSDK on your machine.
Note If you
are referencing NativeSDK headers in the project
*.pch file, you must also add pod
'NativeSDK' to the Tests target.
- Run pod install.
- Open the .xcworkspace file, instead of the
.xcodeproj file. The workspace is now
your regular working area.
Note This version of the SDK supports pod version 0.35.0 and earlier.
|
Configuring dependencies by copying includes and libraries
|
- Select a location to save the project and click
Create to open it.
- Navigate to the
<SMP_HOME>\MobileSDK<vesrion>\NativeSDK\ODataFramework\iOS\
installation directory.
- Copy includes and libraries of components you would like to add
to your project.Select your project from the Project Navigator,
and choose your application's target.
- Open the Build Phases tab, and within
Link Binary with Libraries, add all
necessary native frameworks.
- Choose your project, rather than a specific target, and open the
Build Settings tab:
- In the Other Linker Flags section, add
-ObjC and
-all_load. If these settings
are not visible, change the filter in the Build Settings
bar from Basic to
All.
- In the header search path section adjust the path to
look for public header files. Depending on where you
copied the header files in previous steps, the path
string looks like this:
$(PROJECT_DIR)/includes/public/**
- In the library search path section adjust the path to
look for the binary files. Depending on where you copied
the library files in previous steps, the path string
looks like this:
$(PROJECT_DIR)/libraries/$(BUILD_STYLE)-universal/*
|
- Build and run your project.