Swift Package Manager Integration
Here you will learn how to integrate the Group Link iOS SDK inside your library using the Swift Package Manager dependency manager.
Step 1 - Project package list
In your Xcode Project, select the project icon in the project navigator and select your project configuration file on the sidebar.
Next, select the Package Dependencies submenu on the topbar and click on the + sign to add a new package to your project.
Step 2 - Adding the Group Link Package
A new window will appear, in this window you will search for our package with this url: https://grouplinknetwork@bitbucket.org/group-link-ios/group-link-package.git. Select the Group Link Package and click in the Add Package button, this will fetch the package from our repository and add to your project.
https://github.com/Group-Link-One/iOSGrouplinkStatic
Be sure to select your project checkbox to add the Group Link Package correctly.
Step 3 - Checking for Group Link Package
To check if everything went well, see if the package is present in the sidebar and in the package list screen
Step 4 - Implementing the SDK Functions
To import the GroupLink module into your framework code, use the import attribute with the @_implementationOnly tag as described below. Then, you can proceed with the iOS Initialization process.
import Foundation
@_implementationOnly import GroupLinkStatic
public class TestFrameworkSDK {
public static func printVersion() {
print("Test Version: 1.0.0")
}
public static func startTestFramework() {
print("Starting Test Framework")
// ...
GroupLinkSDK.start(withToken: "")
GroupLinkSDK.startBluetooth()
}
}
Step 5 - Distributing the framework
Once you've added all the code, ensure that your framework includes the GroupLink.xcframework file in your build. You can verify this information within your project file's Build Phases.
The finalized framework folder structure should resemble the following format.