iOS Examples
1. Basic Initialization
import AppLocatorSDK
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Task {
do {
try await LocatorServiceSdk.shared.start()
} catch {
if let sdkError = error as? LocatorServiceSdkConfigurationError {
presenter.openAlert(text: sdkError.message)
return
}
if let sdkError = error as? LocatorServiceSdkPermissionError {
if sdkError.permissions.contains(.LOCATION) || sdkError.permissions.contains(.BACKGROUND_LOCATION) {
presenter.openAlert(text: "Falta permissão de localização")
return
}
if sdkError.permissions.contains(.MICROPHONE_ACESS) {
presenter.openAlert(text: "Falta permissão de áudio")
return
}
if sdkError.permissions.contains(.USER_NOTIFICATIONS) {
presenter.openAlert(text: "Falta permissão de notificações")
return
}
}
}
}
return true
}
}2. Initialization with configuration
3. Initialization with integrator
4. Examples of functions
Function destroy
destroyFunction execute
executeFunction getConfig
getConfigFunction getFeatures
getFeaturesFunction getGroups
getGroupsFunction getJwtToken
getJwtTokenFunction getSdkMode
getSdkModeFunction getSession
getSessionFunction getState
getStateFunction getVersion
getVersionFunction pendingPermissions
pendingPermissionsFunction registerIntegration
registerIntegrationFunction setConfig
setConfigFunction setFeatures
setFeaturesFunction setGeofences
setGeofencesFunction setGroups
setGroupsFunction setMutableLicense
setMutableLicenseFunction setSdkMode
setSdkModeFunction setState
setStateFunction sendEvents
sendEventsFunction sendLocations (sem parâmetros)
sendLocations (sem parâmetros)Function sendLocations (com parâmetro)
sendLocations (com parâmetro)Function start
startFunction stop
stopFunction syncAll
syncAllFunction syncConfig
syncConfigFunction syncFeatures
syncFeaturesFunction syncGeofences
syncGeofencesFunction syncGroups
syncGroupsFunction syncScopes
syncScopesLast updated
