LO - iOS SDK
V 2.5.2 (released 15/11/23)
Support
- The LANDMARKS ID SDK supports iOS 10.0 and above.
Setup Instructions
Using Cocoapods
- If you previously included the SDK manually please delete it from the project.
- Include the LandmarksID pod in the Podfile.
pod 'LandmarksID/LO', :git => 'https://github.com/LANDMARKSID/LandmarksID-iOS.git', :tag => '2.5.2'
- Run
pod install
.
Manual setup
- Download the SDK from our release page.
- Drag and drop the LandmarksIDSDK.framework into your project.
- Drag and drop the LandmarksIDSDK.framework into your Project's Embedded Binaries.
iOS Configuration Information
Required location usage descriptions
Starting from iOS 8, a usage description is required to be set in the applications info.plist
when utilising Location services.
- Locate the app's
info.plist
file in the Supporting Files folder of the Xcode project. - Dependent on the apps location requirements;
- If the app requests Whilst In Use location authorisation.
Select the icon and set the below description values for the application.
- `Privacy - Location When In Use Usage Description`
- If the app requests Always location authorisation.
Select the icon and set the below description values for the application (it is mandatory that all are set).
- `Privacy - Location Always and When In Use Usage Description`
- `Privacy - Location Always Usage Description`
- `Privacy - Location When In Use Usage Description`
Required background modes (Only if the app requests Always location authorisation)
- Locate the app's
info.plist
file in the Supporting Files folder of the Xcode project. - Select the file once to display the Key/Value pairs in the editor pane.
- Find an existing entry titled 'Required background modes' or create one if it does not exist.
- Select the (+) icon and select from the drop-down list provided: App registers for location updates.
Edit the AppDelegate
Import the LANDMARKS ID SDK into
AppDelegate.swift
import LandmarksIDSDK
Add
landmarksIdManager
as a property on theAppDelegate
var landmarksIdManager: LandmarksIDManagerDelegate?
Add the following Snippets to the app delegate functions:
application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
let appId = "APP_ID" let appSecret = "APP_SECRET" self.landmarksIdManager = LandmarksIDManagerDelegate.initialize(appId, appSecret: appSecret) landmarksIdManager?.setup()
applicationDidBecomeActive(_ application: UIApplication)
self.landmarksIDManager?.startTracking()
applicationDidEnterBackground(_ application: UIApplication)
self.landmarksIDManager?.stopTracking()
func applicationWillTerminate(_ application: UIApplication)
LandmarksIDManagerDelegate.sharedManager()?.applicationWillTerminate()
Additional Controls
Controlling Location Manager Access
To avoid initiating unwanted location permission prompts, the LANDMARKS ID SDK will only access the location manager when allowLocationPermissionsRequest
is set to true
. This should be set to true, after the application has used the location manager for the first time, or at any point, if the application wants the LANDMARKS ID SDK to handle location permission requests.
- If the app must only access location while in use then
LandmarksIDManagerDelegate.sharedManager()?.requestLocationPermissions(.authorizedWhenInUse)
- Otherwise, if the app should always access location
LandmarksIDManagerDelegate.sharedManager()?.requestLocationPermissions(.authorizedAlways)
Controlling User Data Collection
These functions are designed for applications that have controls in place for managing device level data collection. When the isAllowedToRecordData
function is set to false
the LANDMARKS ID SDK will not record any data from the device.
- Checking if it is allowed to collect data for the user (Default:
true
).LandmarksIDManagerDelegate.sharedManager().isAllowedToRecordData()
- Stop recording data for the user.
LandmarksIDManagerDelegate.sharedManager().stopRecordingData()
- Restart recording data for the user.
LandmarksIDManagerDelegate.sharedManager().restartRecordingData()
Sending Additional Data
User data that is collected by, or made available to, the application can be attach to the LANDMARKS ID SDK session as custom values. These will be recorded by the LANDMARKS ID SDK with each location event. Multiple custom values can be passed into each function.
Standardised - Functions provisioned for specific user data
- Set Clients Customer ID
LandmarksIDManagerDelegate.sharedManager().customerId = "CUSTOMER_ID"
Custom - Functions provisioned for all other non specific user data
Set an integer value
LandmarksIDManagerDelegate.sharedManager().setCustomInt("rank", value: 12)
Set a float value
LandmarksIDManagerDelegate.sharedManager().setCustomFloat("score", value: 23.29)
Set a string value
LandmarksIDManagerDelegate.sharedManager().setCustomString("mobile", value: "123134323432")
Files Size
SDK File Size - 650 KB (Compiled Size ~ 49 KB)
Contact Details
If you have any further questions please do not hesitate to contact our friendly team at;