iOS Setup

< Back

Welcome to the official documentation of How to implement the Locator iOS SDK.

iOS Release Notes described in Release Notes iOSarrow-up-right


Add SDK

Para adicionar o pacote do SDK, primeiramente você deve gerar um token de autenticação dentro do Azure Devops. No painel do Azure Devops, acesse User settings, após acessar o user settings acessar a seção de Personal access tokens.

Now click on + New Token to create a new token. When creating the new token, make sure it has Read permission within the Code section.

After creating the Token, to add the SDK package, you must go to xcode -> File -> Add Package Dependencies....

When you open the Package Manager dialog, you should go to the Search or Enter Package URL input and search for the SDK using the following URL format below:

https://automator:AZURE_TOKEN@dev.azure.com/datamob/DTB-VIVO-LOCATOR/_git/dtb-vivo-locator-ios

Preferably, select Up to Next Major Version as the Dependency Rule.


Permissions

The SDK requires that some permissions be requested from the user in order for its features to work properly. To do this, you must add the following keys to your application's info.plist file.

<key>NSCriticalMessagingUsageDescription</key>
<string>This app needs your permission to receive critical alerts.</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to function correctly.</string>

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs background location access to function correctly.</string>

<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to the microphone.</string>

<key>NSMotionUsageDescription</key>
<string>This app needs access to accelerometer data to detect falls.</string>

Capabilities

The SDK requires that certain capabilities be added to the application. To do this, you must add the following keys to your application's info.plist file.


Background Tasks

The SDK requires that the identifiers of the tasks scheduled to run in the background be added. To do this, you must add the following keys to your application's info.plist file.


Initialization

To start using the SDK, you need to initialize it, we recommend initializing it inside the application(_:didFinishLaunchingWithOptions:) method of AppDelegate. If you are not using the AppDelegate file, initialize the SDK in the class that starts your application.

Push Notification

For Push Notifications to execute received commands, simply implement the code below within the func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) method in your application's AppDelegate.

Last updated