ποΈ Getting Started
Technical guide for integrating the ROOK SDK on iOS. Details Xcode requirements, installation methods via Swift Package Manager or CocoaPods, and mandatory HealthKit configuration.
ποΈ Grant Permissions
ROOK SDK requires that the user explicitly grant permissions to access and extract data from Apple Health.
ποΈ Update User ID
Before any data synchronization, we need to set or configure a user to identify the data and know who owns the information. We recommend configuring this after your login using the updateUser function of UserManager as shown below.
ποΈ Configure Background
Setting background functions allows us to send new information as we get notified, helping to resend that information to you through your webhook previously configured in the ROOK Portal.
ποΈ Manual Sync
If you want to sync data every time a user opens the app, RookConnectConfigurationManager provides a function called enableSync(). Each time the app transitions from the background to the foreground, ROOK SDK will check the last sync time. If there is new data to update or pending data from previous days, it will upload this information.
ποΈ Steps
This feature retrieves the step count for the current day. Use an instance of the RookEventsManager class, which includes the getTodayStepCount function to obtain the current step count.
ποΈ Calories
This feature retrieves the calories count for the current day. Use an instance of the RookEventsManager class, which includes the getTodayCalories function to obtain the current calories burned count retrieved from Apple Health.
ποΈ Apple Health Local
The RookSummaryManager class provides the following methods to fetch a userβs daily summaries. Returned data is sourced from Apple HealthKit and may include contributions from third-party apps and devices that write to HealthKit.
ποΈ Best practices
We recommend following the bellow practices in your project:
ποΈ Extra: Known exceptions
rook-sdk returns custom exceptions wrapped in a Result object in each function when an issue is encountered. Below