Skip to main content

Usage: SDK initialization

Set your credentials and get authorization of usage.

Initialize

To initialize call initRook with your credentials and an environment:

void initialize() {
final configuration = RookConfiguration(
clientUUID: clientUUID,
secretKey: secretKey,
environment: environment,
// If true background sync will start when the SDK is initialized
enableBackgroundSync: true,
);

if (isDebug) {
RookSamsung.enableNativeLogs();
}

RookSamsung.initRook(configuration).then((_) {
// Success
}).catchError((error) {
// Handle error
});
}
tip

You should only initialize the SDK once per app launch.

tip

We recommend you to ask your users if they want to enable the automatic sync and steps tracking, then save their preference in local storage and set enableBackgroundSync conditionally.