Skip to Content

Create an App Using the SAP BTP SDK Assistant for iOS

Create a simple app generated by the SAP BTP SDK Assistant for iOS using the Sample OData service.
You will learn
sandeep-tdsSandeep T D SJanuary 24, 2023
Created by
sandeep-tds
January 24, 2023
Contributors
sandeep-tds
  • How to create an app configuration on SAP Mobile Services Admin cockpit.
  • Capabilities of Sample OData service provided by SAP Mobile Services.
  • How to create an native iOS application using the SAP BTP SDK for iOS Assistant.
  • Using the Online & Offline in the generated app.

Congratulations on successfully building an iOS application using the SAP BTP SDK Assistant for iOS that seamlessly connects to SAP Mobile Services.

  • Step 1
    1. Go to your SAP Mobile Services account.

      SAP Mobile Services Home

      If stuck, please review the pre-requisites of this tutorial.

    2. Click Mobile Applications → Native/MDK in the sidebar.

      Native Apps Sidebar Menu Item
    3. Click New located at the top right corner.

    4. Use the following table to fill the details requested in the New Application Wizard.

      Key Value
      IDsdk.ios.assistant.app
      NameiOS Assistant App
      DescriptionReusable server-side app configuration for creating an app using iOS Assistant.
      VendorNo Change
      License TypeNo Change
      Domain of Application RouteNo Change
    5. Click Next.

      New App Wizard First Screen
    6. Click Next on the XSUAA Settings step of the Wizard without making any changes.

    7. Select Native Application in the Assign Features for drop down menu.

    8. Enable Mobile Sample OData ESPM by selecting the check box in the features table.

      New App Wizard Third Screen

      Click here to learn more about the sample service.

    9. Click Finish.

      The app creation may take up to five minutes. Please wait for the app creation to complete successfully before moving to the next step.

    Log in to complete tutorial
  • Step 2
    1. Launch SAP BTP SDK Assistant for iOS.

    2. Click Create New located near the bottom left corner.

    3. Click Reuse Existing Application in the project template step.

      Assistant Project Template Screen

      Click here to learn more about the different types of project templates.

    4. Select the SAP Mobile Services account in which you created the server side configuration and click Next.

      Assistant Account Screen

      If stuck, please review the pre-requisites of this tutorial.

    5. Use your SAP BTP credentials to complete the SSO login.

      This task is only relevant if you chose SSO login during account set up. Click here to learn more about the authentication type for SAP Mobile Services accounts.

    6. Select the app you created in the first step and click Next.

      Server App Screen

      If you can’t see your app, please check if the application has been created through the SAP Mobile Services admin cockpit.

    7. Use your SAP BTP credentials to complete the SSO login.

      This task is only relevant if you chose SSO login during account set up.

    8. Use the following table to fill the project details requested in the Provide the Xcode project configuration step of the assistant, and click Next.

      Key Value
      Product Namemy-first-app
      Organisation NameiOS Assistant App
      Organisation Identifiercom.sap.ios
      Bundle IdentifierAuto generated
      PathNo Change
      Mac CatalystNo Change
    9. Ensure com.sap.edm.sampleservice.v2is present in the Configure the Proxy class generation process step of the assistant, and click Next.

    10. Keep the default settings in the Configure the UI generation for the mobile application step of the assistant, and click Finish.

      After the project generation process is completed, the Xcode project will open. If prompted, click Trust and Open in the warning pop-up.

    Log in to complete tutorial
  • Step 3
    1. Open my-first-appmy-first-appOnboardingOnboardingFlowProvider.

      You can use Command + Shift + O o and type the name of the file to open it quickly.

    2. Search for onboardingSteps to view the function responsible for providing onboarding steps (e.g. Log In, User Consent, Passcode etc.) required by most enterprise mobile applications.

    3. Open my-first-appmy-first-appViewControllersProduct.

    4. You will have a storyboard file and two controller files configured to show a list detail view in the app. The assistant automatically creates these files for all the entities present in the Mobile Sample OData ESPM configured.

      File Structure

    SAP BTP SDK Assistant for iOS has generated Proxy Classes for each entity of the specified OData service, generated Views and View Controllers and tied them together in the Main.storyboard file as well as dedicated <Entity>.storyboard files.

    SAP BTP SDK Assistant for iOS can create a ready to run application only for the Mobile Sample OData ESPM service.

    Log in to complete tutorial
  • Step 4
    1. Click (Start the active scheme) in Xcode to run the application.

      Xcode Start Button

      Configure the scheme to run the application on either a simulator or a device of your choice.

    2. Click Start to start the onboarding process.

      App Start Button

    > Wait for Xcode to deploy, install and run your application on the device before starting this task.

    1. Enter your username and password.

      User Log In
    2. Accept user consent requests.

      User Consent
    3. Configure a passcode.

      Set Passcode

      You may be prompted to set up Biometric authentication as we.. These policies can be defined on the SAP Mobile Services admin cockpit.

    4. Allow the app to send push notifications.

      Allow Push
    Log in to complete tutorial
  • Step 5
    1. Click ESPMContainer.

    2. Click Customers.

    3. Click any customer id.

       This data is generated by the sample OData service and may differ from the tutorial.

    4. Click Edit located on the top right corner.

    5. Update the FirstName and LastName.

    6. Click Done located on the top right corner.

    The record gets updated and a confirmation toast message appears.

    Edit Customer

    You can verify the update by going to your SAP Mobile Services Cockpit → Mobile Applications → Native/MDK Application → com.sap.ios.tutorials → Assigned Features → Mobile Sample OData ESPM → v2.

    Log in to complete tutorial
  • Step 6
    1. Turn off network connection on your device.

      If the app is running on a device, turn on the Airplane mode.
      If the app is running on a simulator, turn off the WiFi/Network of your computer.

    2. Click ESPMContainer.

    3. Click Suppliers.

    4. Click located on the top right corner.

    5. Add the requested details.

      Key Value
      CityWalldorf
      CountryDE
      Email Addresssupplier.email@sap.com
      House Number15
      Phone Number123456789
      Postal Code111000
      StreetOld Street
      Supplier IdCustom-new-supplierid123
      Supplier NameNew Custom Supplier
      Updated TimestampNo Change
      ProductsNo Change
      Purchase OrdersNo Change

      The SupplierId may be replaced with GUID after sync.

    6. Click Done located on the top right corner.

      Notice that the toast message says Created in offline mode.

    7. Turn the on the network connection on your device.

    New Supplier

    After sync, you can verify the update by going to your SAP Mobile Services Cockpit.

    The toast message text in case of Online & Offline scenarios are:

    Log in to complete tutorial
Back to top