Getting Started
Required
Needed by every integration.
To start using the IPSFramework on iOS, first perform the steps outlined on this page.
Step 1: Get the Latest Version of Xcode
To build a project with IPSFramework, find a version of Xcode on the Apple Developer site.
Step 2: Install the IPSFramework
Install Using CocoaPods
The IPSFramework for iOS is available as a CocoaPods pod. CocoaPods is a dependency manager. A pod is a library or framework that is added to your project.
1. Install CocoaPods.
For instructions on installing and using CocoaPods, see the CocoaPods Getting Started guide.
2. Provide your credentials.
IPSFramework is a private pod. Therefore, to access IPSFramework, you have to provide credentials.
2.1. In the ~/.netrc file, add the following with your credentials (if a ~/.netrc file does not exist, create one):
machine cocoapods.oriient.me
login [SDK Access Username]
password [SDK Access Password]
2.2. Add the following lines to the top of your Podfile:
# Oriient’s CocoaPods repository
source 'https://gitlab.com/oriient-public/cocoapods.git'
# The global CocoaPods repository
source 'https://cdn.cocoapods.org/'
3. Add IPSFramework to your dependencies.
Now, you can add the latest version of IPSFramework to your Podfile:
use_frameworks!
pod 'IPSFramework','9.11.0'
4. Make sure the target version in your Podfile is at least 13.0.
platform :ios, '13.0'
Your Podfile should resemble the following:
platform :ios, '13.0'
# Oriient's CocoaPods repository
source 'https://gitlab.com/oriient-public/cocoapods.git'
# The global CocoaPods repository
source 'https://cdn.cocoapods.org/'
target 'YourAppName' do
use_frameworks!
pod 'IPSFramework','9.11.0'
end
5. From the project directory, run the following command:
pod install --repo-update
6. To run your project, make sure to open the .xcworkspace* file.*
Install Using Carthage
Carthage is a simple, decentralized dependency manager for Cocoa. The IPSFramework is available for iOS as XCFramework distributed with Carthage.
1. Install Carthage.
For instructions on installing and using Carthage, see the Carthage documentation resource on GitHub.
2. In your Cartfile, add a link to the IPSFramework binary.
Do not forget to replace [SDK Access Username] and [SDK Access Password] with actual values
binary "https://carthage.oriient.me/carthage/IPSFramework.json?api=[SDK Access Username]&apiKey=[SDK Access Password]" == 9.11.0
3. From the project directory, run the following command:
carthage update --use-xcframeworks
Install Using Swift Package Manager
The Swift Package Manager is a tool for managing the distribution of Swift code. It's integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. The IPSFramework is available for iOS as XCFramework distributed with Swift Package Manager.
1. Provide your credentials.
IPSFramework is a private binary package. Therefore, to access IPSFramework, you have to provide credentials.
In the ~/.netrc file, add the following with your credentials (if a ~/.netrc file does not exist, create one):
machine cocoapods.oriient.me
login [SDK Access Username]
password [SDK Access Password]
2. Add package to your project.
Follow the instructions provided by Apple to add the package dependency to your Xcode project.
Use https://gitlab.com/oriient-public/ipsframework-spm.git as the repository URL and specify the relevant version of the SDK. Current version is 9.11.0.
Step 3: Provide Location Services Access
Oriient's Positioning and Calibration services require user permission to use Location services.
Access to Always Authorization is preferred as it will allow to wake app the application once the device is in proximity of one of the your venues and initiate a calibration session.
You can find further details about iOS Authorization Level for Location Services here.
Starting from iOS 14, Positioning service also requires full accuracy access. Full accuracy is enabled by default, but in case the user decided to disable it you can ask for one-time permission before starting a positioning session. See Request the user’s permission to temporarily use location services with full accuracy.
Step 4: Enable Background Location Access.
To enable positioning and calibration usage while the application is in background configure the Location updates capability for your app in Xcode as it is described here.
Step 5 (Optional): Provide Motion Permission (iOS 17.4+)
Oriient uses Altimeter (aka Barometer, aka Pressure sensor) to accurately detect changes in elevation, such as ascending or descending floors indoors. Altimeter is a must-have sensor for navigation in a multi-floor building.
Starting from iOS 17.4 (Released March 5, 2024) Apple started requesting the Motion permission for CMAltimeter sensor (Apple Developer Forum discussion) therefor any application that wants to use Oriient SDK to navigate in a multi-floor building has to ask the users for the Motion permission. Navigation in a single-floor building does not require any additional permissions on top of the Location Permission.
There are a few necessary actions to manage the Motion permission:
Update Info.plist: Include NSMotionUsageDescription key in your application’s Info.plist with the text that will be displayed to the user when requesting permission;
Check the current permission status: Use CMAltimeter.authorizationStatus() to access the current permission status. Positioning in a multi-floor building is only available if the status is authorized;
Request the permission: Core motion does not have a dedicated method to trigger a dialogue asking a user to access the Motion permission but you can use other Core Motion methods, for example CMSensorRecorder.recordAccelerometer(forDuration: 0.5). In case the user already denied the permission, you can also instruct them and redirect to your application’s page in Settings.
Step 6: Enable Background Data Uploading.
While positioning, the SDK collects the information about the magnetic field and uploads it to Oriient's servers. For this requirement, the uploading method we use is OS discretionary (See isDiscretionary) and the moment when it happens is decided by iOS and adapted to each specific user.
Please add this code to your Application Delegate:
func application(
_ application: UIApplication,
handleEventsForBackgroundURLSession identifier: String,
completionHandler: @escaping () -> Void
) {
if IPSCore.application(
application,
handleEventsForBackgroundURLSession: identifier,
completionHandler: completionHandler
) {
// The session will be handled by Oriient
return
}
// This session is not relevant to Oriient and should be handled by you
// Probably was initiated by another service
}
Warning
Enabling the data uploading is a MUST for Oriient to maintain up-to-date magnetic maps, without it there's a risk to the positioning performance.
Step 7: Start Using the IPSFramework
The IPSFramework is now ready for use!
Enabling Framework services requires logging into the system. Continue to the Login Guide for instructions.