> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# appIsNotActive When Starting Mobile SDK Recording

> Start Mobile SDK recording only while the app is in the foreground

`appIsNotActive` is a `SukiAmbientCoreError` case. Recording cannot start while the app is in the background. iOS does not allow apps to begin audio recording from the background in this flow.

| Error id | Description |
| :- | :- |
| `appIsNotActive` | Recording cannot start while the app is in the background |

Common causes:

* Start recording runs from a background task, notification action, or delayed callback after the user left the app
* Lifecycle code starts recording while the scene is inactive

## Catch and recover

Match the case name in your `SukiAmbientCoreError` handler:

```swift Swift theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
do {
  // Mobile SDK call that starts or resumes recording
} catch let error as SukiAmbientCoreError {
  switch error {
  case .appIsNotActive:
    // Ask the clinician to bring the app to the foreground, then retry
    break
  case .micIsInUse:
    // Another app holds the microphone
    break
  case .needMicrophonePermissionRecording:
    // Request microphone permission, then retry
    break
  default:
    break
  }
}
```

## Fix

<Steps>
  <Step title="Catch appIsNotActive">
    Handle `appIsNotActive` specifically. Ask the clinician to return the app to the foreground before recording.
  </Step>

  <Step title="Start Only When Active">
    Call start or resume recording only when the app is in the foreground and active.
  </Step>

  <Step title="Retry After Foreground">
    When the app becomes active again, retry start. Do not call start from a background context.
  </Step>
</Steps>

## Next steps

<Icon icon="file-lines" iconType="solid" /> **[Mobile SDK error messages](/mobile-sdk/error-messages)** - Full `SukiAmbientCoreError` case list

<Icon icon="file-lines" iconType="solid" /> **[Mobile SDK troubleshooting FAQs](/mobile-sdk/faqs/troubleshooting)** - AppIsNotActive recording FAQ

<Icon icon="file-lines" iconType="solid" /> **[Session management FAQs](/mobile-sdk/faqs/session-management)** - Background recording and session errors

<Icon icon="file-lines" iconType="solid" /> **[micIsInUse on Mobile SDK](/documentation/troubleshooting/mic-is-in-use-mobile)** - Microphone held by another app

<Icon icon="file-lines" iconType="solid" /> **[Microphone permission denied](/documentation/troubleshooting/microphone-permission-denied)** - Browser mic permission failures
