iOS Initialization

Team
SDK Team
Last Updated
June 10, 2026

Here you will learn how to set up all the Group Link iOS SDK functions to run properly in your application.

Step 1 - Initialize the Group Link SDK

Start the library

To initialize the library, a Group Link Token is needed. On your AppDelegate implementation, import the library, and, in the didFinishLaunchingWithOptions:

App Delegate (Obj-C) - Implementation

1#import "AppDelegate.h"
2@import GroupLink;
3
4@interface AppDelegate ()
5
6@end
7
8@implementation AppDelegate
9
10- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
11 // Override point for customization after application launch.
12 [GroupLinkSDK startWithToken: @"GROUP_LINK_TOKEN"];
13
14 return YES;
15}

App Delegate - Implementation

1import UIKit
2import GroupLink
3
4@UIApplicationMain
5class AppDelegate: UIResponder, UIApplicationDelegate {
6
7 func application(_ application: UIApplication,
8 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9 GroupLinkSDK.start(token: "GROUP_LINK_TOKEN")
10
11 ...
12
13 return true
14 }
15}

SwiftUI App Cycle - Implementation (iOS 14)

1import SwiftUI
2import GroupLink
3
4@main
5struct SwiftUIApp: App {
6 init() {
7 GroupLinkSDK.start(token: "GROUP_LINK_TOKEN")
8 }
9
10 ..
11
12 var body: some Scene {
13 WindowGroup {
14 ContentView()
15 }
16 }
17}

Step 2 - Request User Bluetooth Authorization

Anywhere in your App, request authorization to use the user's Bluetooth. If you don't have a Bluetooth manager stack, you just need to call the Group Link framework Bluetooth function, which will request the user authorization to use Bluetooth services. We recommend that you call this function at the start of your application. If you ask for permission after some screen like a login screen, our SDK may not start.

App Delegate (Obj-C) - Implementation

1#import "AppDelegate.h"
2@import GroupLink;
3
4@interface AppDelegate ()
5
6@end
7
8@implementation AppDelegate
9
10- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
11 // The permission is required to start the SDK's Bluetooth manager.
12 // You can execute it during your app's initialization.
13 [GroupLinkSDK startBluetooth];
14
15 return YES;
16}

App Delegate - Implementation

1import UIKit
2import GroupLink
3
4@UIApplicationMain
5class AppDelegate: UIResponder, UIApplicationDelegate {
6
7 func application(_ application: UIApplication,
8 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9 // The permission is required to start the SDK's Bluetooth manager.
10 // You can execute it during your app's initialization.
11 GroupLinkSDK.startBluetooth()
12
13 ...
14
15 return true
16 }
17}

SwiftUI App Cycle - Implementation (iOS 14)

1import SwiftUI
2import GroupLink
3
4@main
5struct SwiftUI_TestApp: App {
6 init() {
7 // The permission is required to start the SDK's Bluetooth manager.
8 // You can execute it during your app's initialization.
9 GroupLinkSDK.startBluetooth()
10 }
11
12 ...
13}

If you are already using the CoreBluetooth framework, call this method within the .poweredOn state of your Bluetooth delegate:

1- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
2 switch ([central state])
3 {
4 case CBCentralManagerStatePoweredOn:
5 [GroupLinkSDK startBluetooth];
6 break;
7 default:
8 break;
9 }
10}
1func centralManagerDidUpdateState(_ central: CBCentralManager) {
2 switch central.state {
3 case .poweredOn:
4 GroupLinkSDK.startBluetooth()
5 default:
6 break
7 }
8}

Remember to always check if the user has granted Bluetooth permission when initializing your application, with the checkBluetooth() SDK function.

App Delegate (Obj-C) - Implementation

1#import "AppDelegate.h"
2@import GroupLink;
3
4@interface AppDelegate ()
5
6@end
7
8@implementation AppDelegate
9
10- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
11 // It is recommended to run this function to check if the user has granted Bluetooth permission.
12 // This function will not prompt for anything. You must call the startBluetooth() function to request permission.
13 [GroupLinkSDK checkBluetooth];
14
15 return YES;
16}

App Delegate - Implementation

1import UIKit
2import GroupLink
3
4@UIApplicationMain
5class AppDelegate: UIResponder, UIApplicationDelegate {
6
7 func application(_ application: UIApplication,
8 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9 // It is recommended to run this function to check if the user has granted Bluetooth permission.
10 // This function will not prompt for anything. You must call the startBluetooth() function to request permission.
11
12 GroupLinkSDK.checkBluetooth()
13
14 ...
15
16 return true
17 }
18}

SwiftUI App Cycle - Implementation (iOS 14)

1import SwiftUI
2import GroupLink
3
4@main
5struct SwiftUI_TestApp: App {
6 init() {
7 // It is recommended to run this function to check if the user has granted Bluetooth permission.
8 // This function will not prompt for anything. You must call the startBluetooth() function to request permission.
9 GroupLinkSDK.checkBluetooth()
10 }
11
12 ...
13}

Step 3 - Request User Location Authorization

Anywhere in your App, request authorization to use the user's location. If you don't have a location manager stack, you just need to call the Group Link framework location function, which will request the user authorization to use location services. We recommend that you call this function at the start of your application. If you ask for permission after some screen like a login screen, our SDK may not start.

App Delegate (Obj-C) - Implementation

1#import "AppDelegate.h"
2@import GroupLink;
3
4@interface AppDelegate ()
5
6@end
7
8@implementation AppDelegate
9
10- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
11 // The permission is required to start the SDK's location manager.
12 // You can execute it during your app's initialization.
13 [GroupLinkSDK startLocation];
14
15 return YES;
16}

App Delegate - Implementation

1import UIKit
2import GroupLink
3
4@UIApplicationMain
5class AppDelegate: UIResponder, UIApplicationDelegate {
6
7 func application(_ application: UIApplication,
8 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9 // The permission is required to start the SDK's location manager.
10 // You can execute it during your app's initialization.
11 GroupLinkSDK.startLocation()
12
13 ...
14
15 return true
16 }
17}

SwiftUI - Implementation (iOS 14)

1import SwiftUI
2import GroupLink
3
4@main
5struct SwiftUI_TestApp: App {
6 init() {
7 // The permission is required to start the SDK's location manager.
8 // You can execute it during your app's initialization.
9 GroupLinkSDK.startLocation()
10 }
11
12
13 ...
14}

Group Link will now start monitoring sensors in range.