Adding the dependency
Cocaopods
Add the following dependencies to your Podfile
, in addition to the Core module, the IPS module, and optionally the Geo module:
pod 'CrowdConnectedCoreBluetooth', '1.4.0'
Swift Package Manager (SPM)
Open your project in Xcode and navigate to File -> Swift Packages -> Add Package Dependency and add the following package, in addition to the core module, the IPS module, and optionally the Geo module:
https://github.com/crowdconnected/crowdconnected-core-bluetooth-ios
Carthage
In your Cartfile
file add the following dependency, in addition to the core module, the IPS module, and optionally the Geo module:
binary "https://crowdconnected-public-maven.s3.eu-west-1.amazonaws.com/iOSSources/crowdconnected-corebluetooth-sources" == 1.3.0
Run the following command in terminal:
carthage update --use-xcframeworks --no-use-binaries
On your application targets’ General settings tab, in the Embedded Binaries section, drag and drop the following xcframework (in addition to the core module, the IPS module, and optionally the Geo module) from the Carthage/Build folder on disk.
CrowdConnectedCoreBluetooth.xcframework
Starting the library
Add the IPS module to your imports.
import CrowdConnectedIPS
import CrowdConnectedCore
import CrowdConnectedCoreBluetooth
Then before you start the library, following the Base Integration Guide, activate the CoreBluetooth module.
CrowdConnectedIPS.activate()
CrowdConnectedCoreBluetooth.activate()
CrowdConnected.shared.start(appKey: "YOUR_APP_KEY", token: "YOUR_TOKEN", secret: "YOUR_SECRET") { deviceId, error in
// If the completion returns a non-nil Error, then the SDK has failed to start and is not functional.
// Otherwise, the completion will provide a valid device ID and a nil Error
}