Quickstart KMP (iOS)

Team
SDK Team
Last Updated
June 2, 2026

Step 1 - Opening the KMP project in Xcode

  1. Access the iosApp folder created by KMP.
  2. Open the iosApp.xcodeproj file in Xcode.
Janela do Finder no macOS exibindo o conteúdo da pasta 'iosApp'. O nome da pasta 'iosApp' no topo da janela está destacado em vermelho, e o arquivo iosApp.xcodeproj está destacado em vermelho com uma seta apontando para ele.

Step 2 - Editing the Info.plist file using the Xcode visual editor

All permissions for your iOS application are listed in the Custom iOS Target Properties section of Info.plist.

  1. In the file browser (left panel), select your project at the top of the tree.
  2. Select the application's target in TARGETS.
  3. Access the Info tab.
Janela do Xcode exibindo a aba Info do target. Três áreas estão destacadas em vermelho: o nome do projeto no topo do navegador à esquerda, o target do aplicativo na seção TARGETS e a aba Info no topo do editor. À direita, a seção Custom iOS Target Properties lista as chaves das permissões e seus respectivos valores.

Step 3 - Adding permissions

Note: Description messages are displayed when the application requests permission from the user to use a service. Be sure to add a message that is meaningful to your users.

Enable Location Services

To obtain beacon range results, Group Link technology requires Always location authorization. When implementing location services in your app, Apple requires the following keys to be added to your Info.plist file:

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription
Example Description: Location helps ensure more accurate readings and correct alerts about water consumption. This allows the app to deliver consumption data from your home.

Enable Bluetooth Services

Since iOS 13, apps are required to add the Bluetooth permission key to the Info.plist file.

  • NSBluetoothAlwaysUsageDescription
Example Description: To ensure the quality of consumption readings, the app needs to access Bluetooth, which helps collect data more accurately.

Apps supported for iOS 12 and below

If your application can run on older versions of iOS (iOS 12 and below), you will need to place the Bluetooth Peripheral key within your Info.plist file:

  • NSBluetoothPeripheralUsageDescription
Example Description: To ensure the quality of consumption readings, the app needs to access Bluetooth, which helps collect data more accurately.

Enable background task functionality

To enable background tasks in your application, you need to insert the following key into your Info.plist file:

  • BGTaskSchedulerPermittedIdentifiers

Open the created key, Permitted background task scheduler identifiers, and enter our identifier:

  • com.grouplinknetwork.bgtask

Step 4 - Signature Permissions and Capabilities

  1. Select the application's target in TARGETS.
  2. Access the Signing & Capabilities tab.
  3. Click the + Capability button to add the following capabilities:
Aba Signing & Capabilities do target do aplicativo no Xcode. Três áreas estão destacadas em vermelho: o target do aplicativo na seção 'TARGETS', a aba 'Signing & Capabilities' no topo e o botão '+ Capability'.

Enable Access to WiFi Information

Your application must be able to access WiFi network information for Group Link technology to function correctly. To achieve this, you must add the following capability:

  • Access WiFi Information

Enable Necessary Background Modes

Your application must be able to run in background modes for Group Link technology to function correctly. To achieve this, you must add the following capability:

  • Background Modes

Select the following authorizations from the list:

  1. Location updates
  2. Uses Bluetooth LE accessories
  3. Acts as a Bluetooth LE accessory
  4. Background fetch
  5. Background processing

Step 5 - Installing the Group Link package

Adding a new package to your project

  1. In Xcode, locate the panel on the left and click on your PROJECT.
  2. At the top of the open window, click the Package Dependencies tab.
  3. The list of packages used in the project will appear.
  4. Click the + button located in the lower left of this list to add a new package.
Tela do Xcode, com três áreas destacadas em vermelho: a seção PROJECT da barra lateral esquerda, a aba Package Dependencies no topo do editor e o botão de '+' no canto inferior da lista de pacotes. A lista de Packages está vazia (0 items), exibindo a mensagem "Add packages here".

Searching for the package via the GitHub URL

  1. In the search field, in the upper right corner of the window, paste the repository URL:
    https://github.com/Group-Link-Mobile/grouplink-package
  2. In a few moments, the result grouplink-package will appear in the list.
  3. Click on the grouplink-package to select it.
  4. Change the Dependency Rule to Branch and add the main branch.
  5. Click Add Package to add the grouplink-package to the project.
⚠️ Attention: In the Dependency Rule, do not use the options Up to Next Major Version, Up to Next Minor Version, Exact Version, Range of Versions or Commit. The correct configuration is Branch → main. This configuration ensures that you will always use the latest SDK version published by Group Link.
Janela de adição do Swift Package Manager (SPM) no Xcode com a busca retornando o repositório grouplink-package. A URL aparece destacada em vermelho no campo de pesquisa no canto superior direito, e o pacote grouplink-package está destacado em vermelho na lista de resultados. Os campos Dependency Rule definido com a Branch com o valor 'main' estão destacados em amarelo.

Choosing the products for the package

Xcode will resolve the package and open the Choose Package Products for grouplink-package.git window.

  1. Check if the GroupLink package is in the list.
  2. In the Add to Target column, confirm that it is associated with your application.
  3. Click Add Package to confirm adding the package.
Modal de seleção do pacote grouplink-package no Xcode, listando o produto GroupLink do tipo Library a ser adicionado ao target. O botão Add Package, no canto inferior direito do diálogo, está destacado em vermelho.

Verifying the installation

After completion, you will return to the Package Dependencies tab. There, confirm that everything is correct:

Aba Package Dependencies do projeto no Xcode, exibindo 1 item na lista de Packages. O pacote do GroupLink aparece com a location para o repositório do GitHub e a Dependency Rule definida como Branch main.

Step 6 - Starting the Group Link SDK

To initialize the SDK, you need to pass your authentication Token (provided by Group Link).

  • Import the SDK library.
  • In the start method, specify your authentication Token (provided by Group Link) in the withToken parameter.
  • Call the startBluetooth and startLocation methods to request Bluetooth and Location permissions.
1import SwiftUI
2import GroupLink // <---- Importing the Group Link SDK
3
4@main
5struct iOSApp: App {
6 init() {
7 // 1 - Initializing the SDK Group Link
8 GroupLinkSDK.start(withToken: "YOUR_GROUP_LINK_TOKEN")
9
10 // 2 - Requesting Bluetooth permission
11 GroupLinkSDK.startBluetooth()
12
13 // 2 - Requesting Location Permission
14 GroupLinkSDK.startLocation()
15 }
16
17 var body: some Scene {
18 WindowGroup {
19 ContentView()
20 }
21 }
22}
23

Now that the Group Link SDK for iOS is implemented and the native features are configured, your KMP app is ready to interact with our ecosystem!