Android SDK Integration
Use the native Android SDK when you want to host the embedded Ria experience inside your own WebView. Make sure you have already completed the Framework Setup so you understand the SSO token lifecycle, and apply the Android App Configuration settings to grant camera/microphone access.
Step 1: Obtain the AAR
Section titled “Step 1: Obtain the AAR”We provide riassoandroidsdk-release.aar to you directly. You do not need to build it yourself.
Step 2: Add the SDK to your app module
Section titled “Step 2: Add the SDK to your app module”Place the AAR in your app’s libs/ directory and add it as a local dependency:
// app/build.gradle.kts (module-level)dependencies { implementation(files("libs/riassoandroidsdk-release.aar"))}Sync Gradle after adding the file so the SDK classes resolve in your project.
Step 3: Initialize the WebView
Section titled “Step 3: Initialize the WebView”Add a WebView to your layout and initialize the wrapper. Provide user data to prefill registration, and reuse a stored SSO token to auto-login returning users.
import android.content.Contextimport android.content.SharedPreferencesimport android.webkit.WebViewimport androidx.fragment.app.Fragmentimport com.ria.rmtwrapper.TokenListenerimport com.ria.rmtwrapper.UserInfoimport com.ria.rmtwrapper.WebViewWrapper
class MoneyTransferFragment : Fragment(), TokenListener { private val wrapper = WebViewWrapper.getInstance() private val prefs: SharedPreferences by lazy { requireContext().getSharedPreferences("ria_prefs", Context.MODE_PRIVATE) }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { val webView = view.findViewById<WebView>(R.id.riaWebView)
// Register to receive fresh SSO tokens wrapper.setTokenListener(this)
// (Optional) force a specific package name for theming before init wrapper.setPackageName(requireContext().packageName)
val payload = UserInfo( email = "user@email.com", phoneNumberCountry = "1", phoneNumber = "5551234567", firstName = "Jane", lastName = "Doe" )
wrapper.initializeWebViewWrapper( payload = payload, // null starts a simple flow webView = webView, context = requireContext(), ssoToken = loadSavedToken(), // use a stored token to auto-login packageNameOverride = null // or set to override theme per load ) }
override fun onTokenReceived(token: String?) { token?.let { saveToken(it) } // persist securely for the next session }
private fun saveToken(token: String) { prefs.edit().putString("sso_token", token).apply() }
private fun loadSavedToken(): String? = prefs.getString("sso_token", null)
fun clearSession() { prefs.edit().remove("sso_token").apply() wrapper.clearToken() // also clears token inside the wrapper }}WebView Key Components
Section titled “WebView Key Components”| Component | Description |
|---|---|
UserInfo | Fields are optional; supply whatever you already know (email/phone at minimum is recommended) |
TokenListener | Fires when a new token is issued; store it securely and pass it back via ssoToken next time |
WebView Public API surface
Section titled “WebView Public API surface”| Method | Description |
|---|---|
WebViewWrapper.getInstance() | Obtain the singleton instance |
setTokenListener(listener) | Register to receive new SSO tokens |
setPackageName(name) | Set the package used for theming before initialization |
initializeWebViewWrapper(...) | Start the flow (payload and token are optional) |
clearToken() | Wipe any token stored in the wrapper (e.g., on logout) |
Step 4: Run the experience
Section titled “Step 4: Run the experience”With the dependency in place and the WebView initialized, the SDK loads the Ria Money Transfer UI directly inside your app, handling authentication and token refresh through the callbacks you implement.