React Native integration

Adding Saakuru Mobile Wallet SDK to your React Native project

Adding Saakuru Mobile Wallet SDK to your React Native project

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-saakuru  
walletsdk.maven.username=given-by-saakuru  
walletsdk.maven.password=given-by-saakuru  
sdk.environment=given-by-saakuru  
sdk.api.client.reference=demo-android-saakuru  
sdk.config.url=<https://static.aag.ventures/metaone/sdkconfig-demo-test.json> // can be changed to achieve custom configuration  
sdk.key=given-by-saakuru  
sdk.realm=given-by-saakuru  
sdk.api.key.phrase=given-by-saakuru

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 a 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:

  1. Initialize user session during initial auth

  2. Refresh the user session when the session expires.

Last updated