02 – iOS quickstart guide

In this tutorial, we will guide you step by step to set up your first application using Situm Wayfinding Module.

Configure the WYF module in your iOS project #

First of all, you must configure Wayfinding Module in your iOS project. Here we will walk you through the proccess.

Add a Podfile to your project’s root directory with the content:

target 'YOUR_TARGET_NAME' do
  source 'https://github.com/CocoaPods/Specs.git'
  platform :ios, '9.0'
  use_frameworks!

  pod 'SitumWayfinding'
end

Then open a Terminal, go to your project´s root directory and run:

pod install

And that’s it! From now on you can import our module in your Swift code with:

import SitumWayfinding
@import SitumWayfinding;

Set your credentials #

There are two ways to set the credentials, programmatically or in the Info.plist file. You should choose the first if you wanna inject the wayfinding view into your app’s UI programmatically and the second if you just want to declare one of your view as a “SitumView”.

Option 1: Set your credentials in your code #

You just need to create an object “Credentials” with your user and your password:

let credentials: Credentials = Credentials(user: "YOUR_DASHBOARD_USER", apiKey: "YOUR_DASHBOARD_APIKEY", googleMapsApiKey: "YOUR_GOOGLE_MAPS_APIKEY")

You can also use your user and APIKEY:

let credentials: Credentials = Credentials(user: "YOUR_DASHBOARD_USER", password: "YOUR_DASHBOARD_APIKEY", googleMapsApiKey: "YOUR_GOOGLE_MAPS_APIKEY")

This object we just created will be used later to authenticate for Situm and GoogleMaps services.

Option 2: Set your credentials in Info.plist file #

Open the plist file in your project as source code and add your credentials like this:

<key>es.situm.sdk.API_USER</key>
<string>YOUR_DASHBOARD_USER</string>
<key>es.situm.sdk.API_KEY</key>
<string>YOUR_DASHBOARD_APIKEY</string>
<key>com.google.android.geo.API_KEY</key>
<string>YOUR_GOOGLE_MAPS_APIKEY</string>

Please note that this option only allows authentication using APIKEY.

Load our SitumMapView #

The last step you need to follow is loading our “SitumView” into your app. This can be done in two ways: programatically or through your storyboard.

Option 1: Programmatically #

Create a “SitumMapsLibrary” object and specify the containing superview and its controller:

let library: SitumMapsLibrary = SitumMapsLibrary(containedBy: containerSuperview, controlledBy: containerSuperviewController)

Set your credentials that we created in Step 2 (in the first option):

library.setCredentials(credentials)

Use the “SitumMapsLibrary” object to load the “SitumView “by selecting the building for positioning:

facade.load(buildingWithId: buildingIdentifier)

Option 2: Declare SitumView in your storyboard #

The second option allows you to declare any view in your storyboard as a SitumView. Just select the one you want, open the identity inspector and type “SitumView” as custom class and “SitumWayfinding” as the custom module. Please remember that this option will only work if you include your credentials in your plist file

Enjoy your new app! #

Congratulations! You’ve just created your first positioning app in just a few steps. With SitumWayfinding you and your users will be able to position inside a building, ask for routes to a selected point, receive navigation instructions, and much more.

For more information, please check our docs.

Subscribe to our newsletter

BASIC INFORMATION ON DATA PROTECTION

Data controller: SITUM TECHNOLOGIES, S.L.
Contact: Data controller: situm@situm.es
Responsible for protection: dpo@situm.es
Purpose and legal basis: To manage the sending of SITUM newsletters only with consent.
Legitimation: Express consent of the interested party.
Recipients: The data will not be passed on to third parties with the exception of legal obligations.
Retention period: As long as the interested party remains subscribed to the newsletter (a link to unsubscribe will be available in each newsletter sent by Situm).
Rights: The interested party may at any time revoke their consent, as well as exercise their rights of opposition, access, conservation, rectification, limitation, deletion of data and not be subject to a decision based only on automated data processing, by writing to SITUM at the addresses indicated.
Additional Information: You can consult additional and detailed information on Data Protection in our privacy policy.

Please, download your copy here

Thank you for downloading our whitepaper. Please do not hesitate to contact us if you would like to know more about how our solutions can help your business. Download whitepaper


Close window