Getting started
The Fundamentals section of this documentation provides a tour of the most important aspects of the ROOK SDK. It covers everything you need to know to integrate us into your application.
Minimum requirements
ios
>= 13.0XCode
>= 14.2
Installation
Swift Package Manager
- To add a package dependency to your Xcode project, select File > Swift Packages > Add Package
- In the prompt that appears, select the Rook GitHub repository:
https://github.com/RookeriesDevelopment/rook-ios-sdk.git
- Select the version of Rook you want to use. For new projects, we recommend using the newest version of Rook.
Once you finish, Xcode will begin resolving your package dependencies and downloading them in the background.
Cocoapods
Firebase supports installation with CocoaPods in addition to Swift Package Manager.
ROOK's CocoaPods distribution requires Xcode 14.2 and CocoaPods 1.12.0 or higher. Here's how to install ROOK using CocoaPods:
- Create a Podfile if you don't already have one. From the root of your project directory, run the following command:
pod init
- To your Podfile, add the Rook pod to use in your app.
pod "RookSDK"
- Install the pods, then open your .xcworkspace file to see the project in Xcode:
pod install --repo-update
open your-project.xcworkspace
Configure Project
We need to add Apple Health Kit Framework to our project in order to that please:
Open your project in Xcode.
Click on your project file in the Project Navigator.
Select your target and then click on the "Signing Capabilities" tab.
Click on "Add Capability" and search for "HealthKit"
Enable Background delivery
Click on "Add Capability" and search for "Background Modes"
Enable Background fetch from Background Modes.
Additionally add the following to the info.plist
<key>NSHealthShareUsageDescription</key>
<string>This app requires access to your health and fitness data in order to track your workouts and activity levels.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>This app requires permission to write healt data to HealthKit.</string>
Initialize Rook in your app
RookConnectConfigurationManager
Use this class to configure and Init the sdk.
This class conforms the singleton pattern, to access this class use the shared property.
It is recommended to configure and init rook sdk in in your app delegate's
application(_:didFinishLaunchingWithOptions:)
method:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
RookConnectConfigurationManager.shared.setEnvironment(.sandbox)
RookConnectConfigurationManager.shared.setConfiguration(
clientUUID: "YOUR-CLIENT-UUID",
secretKey: "YOUR-SECRET-KEY",
enableBackgroundSync: true,
enableEventsBackgroundSync: true)
RookConnectConfigurationManager.shared.initRook()
return true
}