Important
This guide refers to the old version of the Wayfinding module, which is no longer maintained. We strongly recommend adopting MapView, the new visual component available for iOS. To stay up to date, checkout the Situm iOS SDK changelog.
Situm Wayfinding Module written in Swift for iOS devices has been designed to create indoor location applications in the simplest way. It has been built in the top of the Situm SDK and allows users to position in a building, see its floors, see the building POIs (Point Of Interest), create routes to any point of the building, receive instructions to reach a place and more. If you are interested in building applications using the Situm SDK, please refer to Situm iOS SDK Sample app.
You will need to sign a Contributor License Agreement (CLA) before making a submission. Learn more here.
This code is in alpha release. Modifying SitumWayfinding code is not recommended at this stage. To work with SitumWayfinding use the offered public methods.
- MacOS.
- Xcode. More about this IDE [here] (https://developer.apple.com/xcode/).
- Cocoapods. Information about the installation process [here] (https://guides.cocoapods.org/using/getting-started.html).
To run the example project, clone the repo, and run pod install
from the Example directory first.
Afterwards you would need to provide yours apikeys. You can do that from WayfindingController, replace the indicative texts with your Situm Dashboard, Google Maps Credentials and a proper Building ID.
SitumWayfinding is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SitumWayfinding'
To provide user location SitumWayfinding needs some system permissions.
Go to the Info tab of the Settings of your app. We need to add descriptors for the system permissions, accompanied with a label of your liking. The description value of these keys can be anything you want, for example just type “Location and bluetooth is required to find out where you are”. The required keys to use our SDK are the following:
- NSLocationAlwaysUsageDescription (in XCode, “Privacy - Location Always Usage Description”).
- NSLocationWhenInUseUsageDescription (in XCode, “Privacy - Location When In Use Usage Description”).
- NSBluetoothPeripheralUsageDescription (in XCode, “Privacy - Bluetooth Peripheral Usage Description”).
- Only if you are targeting iOS13.0 or superior: NSBluetoothAlwaysUsageDescription (in XCode, “Privacy - Bluetooth Always Usage Description”)
In order to use both SitumSDK and GoogleMaps capabilities you need to authenticate yourself.
This can be done by storing the credentials in a Credentials
object that will later be forwarded to the SitumMapsLibrary
initializer.
You should also provide the SitumMapsLibrary
with the UIView, the UIViewController that are gonna contain the wayfinding UI and some settings to adjust the behaviour of the module.
Finally, you just need to call the load() method. The following example illustrates this process:
let credentials = Credentials(user: "YOUR SITUM USER", password: "YOUR SITUM PASSWORD", googleMapsApiKey: "YOUR GOOGLE MAPS API KEY")
let buildingId = "YOUR_BUILDING_ID"
let settings = LibrarySettings.Builder()
.setCredentials(credentials: credentials)
.setBuildingId(buildingId: buildingId)
.build()
let library = SitumMapsLibrary(containedBy: containerView, controlledBy: containerViewController, withSettings: settings)
do{
try library.load()
}catch{
// PROPERLY MANAGE ERROR
}
SitumWayfinding is available under the MIT license. See the LICENSE file for more info.