Native mobile integration

# Mobile Widget SDKs

Add Returning.AI custom widgets to an existing mobile application while keeping authentication, navigation, events, and lifecycle control in native code.

> Keep access credentials on your server
>
> A mobile app requests a short-lived embed token from your trusted backend. Never ship a Returning.AI access ID or access key inside the app.

## Choose your platform

Each package provides a native surface around the same secure custom widget contract. Choose the package that matches the host application.

Flutter

### Flutter widget for Android and iOS

`returningai_widget`

Flutter 3.38+ and Dart 3.10+

[Open the Flutter guide](https://docs.returning.ai/mobile-widget-sdk/flutter.md)

Android

### Native View and Jetpack Compose

`ai.returning:returningai-widget`

Android API 24+ and JVM 17

[Open the Android guide](https://docs.returning.ai/mobile-widget-sdk/android.md)

iOS

### UIKit and SwiftUI

`ReturningAIWidget`

iOS 15+ and Swift Package Manager

[Open the iOS guide](https://docs.returning.ai/mobile-widget-sdk/ios.md)

React Native

### React Native CLI and Expo development builds

`@returningai/react-native-widget-sdk`

React Native 0.86+ and React 19.2+

[Open the React Native guide](https://docs.returning.ai/mobile-widget-sdk/react-native.md)

## How the mobile integration works

1. 1. Enroll the signed-in user. Match the identifiers configured for the target widget and environment.
2. 2. Mint an embed token. Your backend uses its server credentials and returns only the short-lived token to the app.
3. 3. Mount the supplied widget. Configure the widget ID, matching bundle URL, exact client origin, and token provider.
4. 4. Own the host lifecycle. Handle renewal, navigation, logout, account replacement, and disposal from the host application.

## Before you start

- Get the supplied widget ID and matching bundle URL. Use the [widget catalog](https://docs.returning.ai/concepts/widget-types.md) to understand experiences, not to invent an ID.
- Confirm the user exists in the target environment. See [enroll traders](https://docs.returning.ai/broker-integrations/users.md).
- Ask your Returning.AI setup contact to allow the exact client origin for each widget.
- Keep the host backend responsible for user identity and embed-token minting.

## Shared guides

[Authentication Mint and renew short-lived embed tokens securely.](https://docs.returning.ai/mobile-widget-sdk/authentication.md) [Configuration Set content, runtime, callbacks, display, and navigation.](https://docs.returning.ai/mobile-widget-sdk/configuration.md) [Lifecycle Manage readiness, logout, account replacement, and disposal.](https://docs.returning.ai/mobile-widget-sdk/lifecycle.md) [Troubleshooting Diagnose origin, token, WebView, and platform problems.](https://docs.returning.ai/mobile-widget-sdk/troubleshooting.md)
