LOD - iOS SDK
V 2.4.1 (released 06/01/21)
Support
- The LANDMARKS ID SDK supports iOS 12.0 and above.
Setup Instructions
Using Cocoapods
- If you previously included the SDK manually please delete both
LandmarksIDiOS.framework
andBDPointSDK.framework
from the project. - Include the LandmarksID pod in the Podfile.
pod 'LandmarksID/LOD', :git => 'https://github.com/LANDMARKSID/LandmarksID-iOS.git', :tag => '2.4.1'
- Run
pod install
.
Manual setup
- Download the SDK from our release page.
- Copy
LandmarksIDiOS.framework
andBDPointSDK.framework
into your project directory. - Drag and drop both the main
LandmarksIDiOS.framework
and supplimentaryBDPointSDK.framework
into your Project's Embedded Binaries. - Go to Build Settings, and set the “Always Embed Swift Standard Libraries” Option to “Yes”. NOTE: If BitCode is set to YES, the resulting IPA file size will increase. However, when you submit the app, Apple will recompile it for each platform, and the resulting size installed by the user will be much smaller.
- Go to
Build Phases
, selectNew Run Script Phase
and copy the following snippet. Rename the script toStrip Symbols
.APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" # This script loops through the frameworks embedded in the application and # removes unused architectures. find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK do FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" EXTRACTED_ARCHS=() for ARCH in $ARCHS do echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME" lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH" EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH") done echo "Merging extracted architectures: ${ARCHS}" lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}" rm "${EXTRACTED_ARCHS[@]}" echo "Replacing original executable with thinned version" rm "$FRAMEWORK_EXECUTABLE_PATH" mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH" done
Required background modes
- 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.
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. - 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`
Local Notification Permission Prompt
The SDK is configured to prompt Local Notification Permissions as default. To disable the notification permission prompt, the following key should be declared in the info.plist
:
- Locate the app’s info.plist file in the Supporting Files folder.
- Select the (+) icon to add a new key. BDPointLocalNotificationEnabled, and set the value to Boolean Type.
- `set the value to YES to enable default notification prompt`
- `set the value to NO to disable default notification prompt`
Edit the AppDelegate
Import the LANDMARKS ID SDK
import LandmarksIDiOS
Copy the following snippet into
application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
let appId = "APP_ID" let appSecret = "APP_SECRET" let apiKey = "API_KEY" let landmarksManager = LandmarksIDManagerDelegate.initialize(appId, appSecret: appSecret, apiKey: apiKey) landmarksManager?.setup() LandmarksIDLocationManager.getInstance().locationDelegate = landmarksManager LandmarksIDLocationManager.getInstance().sessionDelegate = landmarksManager
Required Application State Transition Management
The LANDMARKS ID SDK must be notified when the application is terminated and when there is a transiton between the Foreground / Background
Call the function below inside applicationWillTerminate(_ application: UIApplication)
when the application is terminated.
LandmarksIDManagerDelegate.sharedManager().applicationWillTerminate()
Call the function below inside applicationDidEnterBackground(_ application: UIApplication)
when the application transitions into the background.
LandmarksIDManagerDelegate.sharedManager().stopTracking()
Call the function below inside applicationWillEnterForeground(_ application: UIApplication)
when the application transitions into the Foreground.
LandmarksIDManagerDelegate.sharedManager().startTracking()
Optional Controls
Requesting Location Permissions
Call the function below to initiate a user location permissions request via the SDK. It is good practice to set a location usage explaination within the Info.plist
describing how you intend to use user's location data (Strongly recommended).
LandmarksIDManagerDelegate.sharedManager().requestLocationPermissions()
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 - 250 MB (Compiled Size ~ 200 KB)
Contact Details
If you have any further questions please do not hesitate to contact our friendly team at;