Step 1: Installing dependency
npm i react-native-metaone-wallet-sdk -s
or yarn add react-native-metaone-wallet-sdk
Step 2: Adding Saakuru Mobile SDK
Android
Add the following config to your "local.properties" file inside the Android directory:
walletsdk.maven.url=given-by-aag
walletsdk.maven.username=given-by-aag
walletsdk.maven.password=given-by-aag
sdk.environment=given-by-aag
sdk.api.client.reference=demo-android-app
sdk.config.url=<https://static.aag.ventures/metaone/sdkconfig-demo-test.json> // can be changed to achieve custom configuration
sdk.key=given-by-aag
sdk.realm=given-by-aag
sdk.api.key.phrase=given-by-aag
Add the following code to your build.gradle file:
url properties.getProperty('walletsdk.maven.url')
credentials {
username = properties.getProperty('walletsdk.maven.username')
password = properties.getProperty('walletsdk.maven.password')
}
buildConfigField "String", "SDK_REALM", "\"${properties.getProperty('sdk.realm')}\""
buildConfigField "String", "SDK_ENVIRONMENT", "\"${properties.getProperty('sdk.environment')}\""
buildConfigField "String", "SDK_KEY", "\"${properties.getProperty('sdk.key')}\""
buildConfigField "String", "SDK_CONFIG_URL", "\"${properties.getProperty('sdk.config.url')}\""
buildConfigField "String", "SDK_API_KEY_PHRASE", "\"${properties.getProperty('sdk.api.key.phrase')}\""
buildConfigField "String", "SDK_API_CLIENT_REFERENCE", "\"${properties.getProperty('sdk.api.client.reference')}\""
iOS
coming soon
Step 3: Initializing SDK
Initialize Saakuru Mobile SDK:
await initialize();
Check session status:
await getSessionActivityStatus();
Step 4: Creating User Session
To successfully initialize a user session your back-end integration has to be ready first. Your backend should receive an Authorization token during the initialization request.
Initialize the session by calling: logInWithSSO(token);
Your session is initialized. You can now use all other functions that require Authorization
Call setupUserData();
to initialize user profile data before allowing him to proceed further
Important:
To ensure a good user experience, we recommend you implement:
- Initialize user session during initial auth
- Refresh the user session when the session expires.