Skip to Content
test
0 %
Create Your First Fiori for iOS App
Details
// Explore More Tutorials

Create Your First Fiori for iOS App

10/21/2018

Create and examine your first Fiori for iOS app using the SAP Cloud Platform SDK for iOS Assistant.

You will learn

  • How to create a Fiori for iOS application
  • What the SAP Cloud Platform SDK for iOS Assistant can generate.

Before you start, make sure you:


Step 1: Configure SAP Cloud Platform SDK for iOS Assistant

If you have already configured the SAP Cloud Platform SDK for iOS Assistant, you can skip this step and proceed with “Step 2 - Run the SAP Cloud Platform SDK for iOS Assistant”.

This step provides simplified steps to configure the SAP Cloud Platform SDK for iOS Assistant application using the SAP Cloud Platform Mobile Services cockpit.

Log on to your SAP Cloud Platform trial account at https://account.hanatrial.ondemand.com/ and once logged in choose Neo Trial as your target landscape. Click on Services on the left side to see all available Services. Scroll down to Mobile Services, std, click on the tile. After the Service page loaded click the Enable button to enable this service. After the Service is enabled click the Go to Service link to open a new window to SAP Cloud Platform Mobile Services.

Alternatively, you can go directly to https://hcpmsadmin-<your_user_id>trial.dispatcher.hanatrial.ondemand.com/

SCPms landing page

Once you’re logged in to SAP Cloud Platform Mobile Services, click the Important Links tab in the lower left bottom. The Important Links section opens.

Locate the tile SAP Cloud Platform SDK for iOS Assistant and click the Importing URLs directly into Assistant link:

Important Links

You should now see the following pop-up:

Import URLs

Click Allow. The SAP Cloud Platform SDK for iOS Assistant application will start. The Add Mobile Services Account settings dialog will open, and both API URL and UI URL parameters are pre-populated automatically:

Import URLs

Provide the following additional details:

Field Value
Name A descriptive name for the configuration, for instance SAP Cloud Platform Mobile Services
Authentication Type Basic Authentication
User Your trial account user
Password Password for your trial account user
Import URLs

Click Save when finished. The account is now added to the SDK Assistant:

Import URLs

Click Back to return to the main screen for the SAP Cloud Platform SDK for iOS Assistant.

Log on to answer question
Step 2: Run the SAP Cloud Platform SDK for iOS Assistant

If you went through “Step 1 - Configure SAP Cloud Platform SDK for iOS Assistant”, the SAP Cloud Platform SDK for iOS Assistant is already running and you may continue to “Step 3 - Create an Xcode Project”.

Double-click the SAP Cloud Platform SDK for iOS Assistant icon to start the application. If no applications have been generated previously, you will see the initial screen:

SDK Assistant
Log on to answer question
Step 3: Create a new application

Click the Create new button in the First Steps section. The first step of the Xcode project generation workflow lets you define the project properties.

Project Properties

Click the Create new Application tile on the right side of the Create a new App step. This will allow us to setup our application project the most flexible way.

Next select your SAP Cloud Platform Mobile Services account and click Next.
Project Properties

In the Add an SAP Cloud Platform Mobile Services application step, add the needed application details to create an application in your mobile services account.

Enter the following details:

Field Value
Application Name MyDeliveries
Application Identifier com.sap.tutorials.demoapp.MyDeliveries
Authentication OAuth2
Project Properties

Click Next to advance to the Destinations step.

Log on to answer question
Step 4: Create a new destination

In the Destinations step, you can define the backend connection. Here you will add the OData endpoint for the DeliveryService OData service.

Destinations

Click the Add new… button. A dialog opens:

Destinations

Enter the following details:

Field Value
Name com.sap.tutorials.demoapp.MyDeliveries
Backend URL https://sapdevsdd27584c4.us2.hana.ondemand.com/codejam/wwdc/services/DeliveryService.xsodata
Proxy Type Internet
URL Rewrite Mode Rewrite URL
Maximum connections Server default
Authentication Type No Authentication
Destinations

Click Save to save the new destination pointing to the backend. It is automatically selected:

Destinations

Click Next to advance to the Features step.

Log on to answer question
Step 5: Enable features

In the Optional Features step, you have the option to enable logging and log uploads, enable remote notifications, use Discovery Service and whether to use Online or Offline OData.

Features

Make sure the checkboxes Enable Log Upload, Enable Remote Notifications and Use Discovery Service for Application bootstrapping are selected, and the OData Provider radio button is set to Enable Online OData and click Next to proceed to the Xcode Project step.

Log on to answer question
Step 6: Set up Xcode Project

In the Xcode Project configuration step you will setup your actual Xcode project for development later on.
Enter the following details:

Field Value
Product Name MyDeliveries
Organization Name <your company name>
Organization Identifier com.sap.tutorials.demoapp
Path <choose a local destination>
Project Properties

Click Next to advance to the Proxy Classes step. Here you can see what destination is going to be used to pull the Metadata of the OData Service to generate the OData Proxy Classes.

Project Properties

Click Next to go to the UI Configuration step. Set the Destination radio button to Master / Detail View with Onboarding for destination: and click finish.

Project Properties
Log on to answer question
Step 7: Generate the Xcode project

After you have clicked Finish in the previous step, the SDK Assistant now loads the OData service’s metadata. This metadata describes the data model, and can be accessed via <service URL>$metadata. For your service, the metadata URL is https://sapdevsdd27584c4.us2.hana.ondemand.com/codejam/wwdc/services/DeliveryService.xsodata/$metadata
Based on this metadata, the OData proxy classes will be generated for the Xcode project.

In addition, the configuration settings you have provided in the SDK Assistant are now being sent to SAP Cloud Platform Mobile Services.

Note: If you have already 5 native applications defined in SAP Cloud Platform Mobile Services, the SDK Assistant will give the following error:

Optional Features

In that case, log on to your SAP Cloud Platform mobile Services account at https://hcpmsadmin-<your_user_id>trial.dispatcher.hanatrial.ondemand.com/ and navigate to Mobile Applications > Native/Hybrid. Select one of the available application configurations and delete it in order for the SDK Assistant to add the new application configuration.

Log on to answer question
Step 8: Examine the generated Xcode project

You can now select the MyDeliveries application project under Recent Projects in the SDK Assistant.

Xcode project overview

If Xcode does not open automatically to show your project, click on the project name in the SDK Assistant and click Open.

In Xcode, the left-hand sidebar of the window shows various Navigators for exploring your project, source control, debugging, and so on. If it’s not already selected, select the Project Navigator by clicking on the folder icon above the left-hand sidebar. This shows all of the files in the project.

Xcode project overview

The Main.storyboard file shows a split-view setup for the generated Master-Detail views.

The MyDeliveries/Onboarding folder contains logic for the user onboarding, authentication and handling of passcodes and Touch ID.

The MyDeliveries/Proxy Classes folder contains the OData proxy classes generated from the OData service. The DeliveryService.swift file in the Proxy Classes/public folder acts as a data service provider to gain access to the OData entities. The two files PackagesType.swift and DeliveryStatusType.swift are classes for the OData entities Packages and DeliveryStatus, respectively. These classes give access to the various properties of the OData entities.

The ViewControllers/PackagesType and ViewControllers/DeliveryStatusType folders contain the master and detail view controllers as well as a storyboard for the Packages and DeliveryStatus entities, respectively.

What does the SAP Cloud Platform SDK for iOS Assistant generate for you? Check all that apply.
×

Next Steps

Back to top