π React Native Quick Start
Prerequisitesβ
- React Native project (see package README for version)
- API key from Client Platform
- Integration checklist
Step 1: Install packageβ
From Downloads:
yarn add /path/to/react-native-azeoo-lib-*.tgz
# or Bitbucket URL from downloads page
Step 2: Android Gradle (required)β
In project-level android/build.gradle:
apply from: "../node_modules/react-native-azeoo-lib/android/azeoolib-dependencies.gradle"
Step 3: Initializeβ
import { AzeooSDK } from 'react-native-azeoo-lib';
await AzeooSDK.initialize('YOUR_API_KEY', {
locale: 'en',
analyticsEnabled: true,
offlineEnabled: true,
});
Step 4: Connectβ
Pass a User JWT created by your backend. See Creating the User JWT for the payload spec and backend code examples.
await AzeooSDK.connect(
userJwt, // JWT from YOUR backend β see link above
gender,
height, // see Configuration for shape
weight,
);
Do not pass userId β the SDK resolves the user from the JWT.
Step 5: Show UIβ
Use embedded components from the package (e.g. nutrition/training views) after connect succeeds.
Navigate programmatically:
import { Destination } from 'react-native-azeoo-lib';
AzeooSDK.navigate(Destination.nutrition.home());
Step 6: Lifecycleβ
Forward app lifecycle when documented for your version:
AzeooSDK.onPause();
AzeooSDK.onResume();
Logoutβ
await AzeooSDK.disconnect();
Next stepsβ
- Creating the User JWT β payload spec and backend code
- Configuration
- UI components