Android · Jetpack Compose · SDK 1.0.2

# Alerts

Display targeted announcements alongside your app's content.

## Prepare an alert

Complete the [Android quickstart](https://docs.mobilejoe.dev/android/quickstart.md) and deliver an alert in the dashboard. Start with **Send to all users** , then test your intended filters.

## Compose integration

```kotlin
import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import dev.mobilejoe.ui.compose.alert.AlertsView

@Composable
fun HomeScreen() {
    Column {
        AlertsView()
        Text("Welcome")
    }
}
```

Place this in `HomeScreen.kt` under your app package and show it inside your existing Material theme. Put `AlertsView` where alerts belong in your layout. Tapping a banner opens its information sheet; dismissing the sheet does not permanently dismiss the alert.

## Loading and refresh

`AlertsView` loads when it is created and reloads whenever its screen starts, for example when the user returns to it. It renders nothing while loading, when empty, or on error; inspect Logcat for `Error loading alerts`. The Android component has no automatic polling or iOS-style refresh interval.

For a custom UI, `dev.mobilejoe.api.alert.Alerts` exposes an `all` flow and suspending `load()`. Each load requests data and replaces the collection. Invoke it from your lifecycle-owned coroutine with error handling and choose your own refresh trigger.

## Targeting and debug mode

Targeting matches the exact `versionName` and OS API level; see [Content delivery](https://docs.mobilejoe.dev/sdk/content-delivery.md#alerts). Pass `isDebugMode = true` to `Joe.configure` during development to receive alerts with **Debug delivery** ; see [Debug mode](https://docs.mobilejoe.dev/sdk/content-delivery.md#debug-mode).

## Verify

Run with debug mode disabled, confirm the published alert appears for an eligible device, and open its details. Check that excluded devices do not receive it. If nothing appears, follow [Troubleshooting](https://docs.mobilejoe.dev/sdk/troubleshooting.md#missing-content).
