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

# Install the Vobiz Flutter SDK

> Add vobiz_webrtc to your Flutter app and configure Android and iOS for calling: SDK levels, microphone and Bluetooth permissions, call-screen plugin manifest fixes, Info.plist, and a setup checklist.

This page adds the SDK to your app and sets up Android and iOS for calling.

## Add the package

Add `vobiz_webrtc` to `pubspec.yaml`:

```yaml pubspec.yaml theme={null}
dependencies:
  vobiz_webrtc:
    git:
      url: https://github.com/vobiz-ai/vobiz-flutter-sdk.git
```

Then run:

```bash theme={null}
flutter pub get
```

Import it wherever you use it:

```dart theme={null}
import 'package:vobiz_webrtc/vobiz_webrtc.dart';

final client = VobizClient();
```

The SDK brings `flutter_webrtc` (`^1.0.0`) with it. Don't pin an older `flutter_webrtc` yourself. No permission plugin is needed: WebRTC asks for the microphone when the first call starts. You can ask earlier with any permission plugin.

## Android

### SDK levels

Use Flutter's defaults (`flutter.minSdkVersion`, `flutter.targetSdkVersion`, `flutter.compileSdkVersion`), or at least:

| Setting | Value | Why |
| - | - | - |
| `minSdk` | 24 | Flutter's current minimum. `flutter_webrtc` itself needs 21. |
| `targetSdk` / `compileSdk` | 36 | Google Play requires target API 36 for new apps and updates from 31 August 2026. |

### Permissions for calling

Add these to `android/app/src/main/AndroidManifest.xml`:

```xml AndroidManifest.xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- Bluetooth headsets: BLUETOOTH up to Android 11, BLUETOOTH_CONNECT from Android 12. -->
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
```

| Permission | Used for |
| - | - |
| `INTERNET` | The signalling WebSocket and call audio. |
| `ACCESS_NETWORK_STATE` | Detecting Wi-Fi, mobile, and offline, so the SDK reconnects as soon as the network changes. |
| `RECORD_AUDIO` | The microphone. A runtime permission: WebRTC asks for it on the first call. |
| `MODIFY_AUDIO_SETTINGS` | Switching between earpiece, speaker, and headsets. |
| `BLUETOOTH` / `BLUETOOTH_CONNECT` | Routing audio to a Bluetooth headset. `BLUETOOTH_CONNECT` is a runtime permission on Android 12 and later: ask for it before routing to a headset. See [Audio routes](https://www.vobiz.ai/docs/integrations/flutter-sdk/in-call-controls.md#audio-routes). |

### Call-screen plugin (incoming calls in the background)

To ring when the app is in the background or closed, apps typically use `firebase_messaging` and `flutter_callkit_incoming` (see [Push notifications](https://www.vobiz.ai/docs/integrations/flutter-sdk/push-notifications.md)). `flutter_callkit_incoming` merges these permissions into your manifest whether you use them or not: `USE_FULL_SCREEN_INTENT`, `DISABLE_KEYGUARD`, `TURN_SCREEN_ON`, `VIBRATE`, `WAKE_LOCK`, `ACCESS_NOTIFICATION_POLICY`, `POST_NOTIFICATIONS`, `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_PHONE_CALL`, `FOREGROUND_SERVICE_MICROPHONE`, `FOREGROUND_SERVICE_CAMERA`, `CAMERA`, and `MANAGE_OWN_CALLS`, plus a service with `foregroundServiceType="phoneCall|microphone|camera"`.

An audio-only app should remove the camera entries. Otherwise Play Console asks you to justify a camera foreground service:

```xml AndroidManifest.xml theme={null}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.CAMERA" tools:node="remove" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" tools:node="remove" />

    <application>
        <service
            android:name="com.hiennv.flutter_callkit_incoming.CallkitNotificationService"
            android:foregroundServiceType="phoneCall|microphone"
            tools:replace="android:foregroundServiceType" />
    </application>
</manifest>
```

`flutter_callkit_incoming` 3.1.6 adds the camera service type only for video calls with `CAMERA` granted, so removing it doesn't affect audio calls. Check the merged manifest (Android Studio > **Merged Manifest**) after you upgrade the plugin.

Play Console asks for these declarations:

* **Foreground service types** `phoneCall` and `microphone`: describe the in-call notification.
* **Full-screen intent** (`USE_FULL_SCREEN_INTENT`): allowed for calling apps. On Android 14 and later the user must grant it in **Settings** > **Apps** > **Special app access** > **Full screen notifications**; without it, an incoming call shows as a heads-up notification only. Ask for it when the user signs in, not on the first ring.
* **Notifications** (`POST_NOTIFICATIONS`): a runtime permission on Android 13 and later.

Firebase needs `android/app/google-services.json` from your own Firebase project.

## iOS

### Deployment target

Set **iOS 15.0**. `flutter_webrtc` alone needs 13.0, but `firebase_core`, `firebase_messaging`, and `flutter_callkit_incoming` need 15.0. Set it in both places, then run `pod install` in `ios/`:

* `ios/Podfile`: `platform :ios, '15.0'`
* Xcode > **Runner** > **Build Settings** > `IPHONEOS_DEPLOYMENT_TARGET` = `15.0`, for all configurations.

### Info.plist

```xml Info.plist theme={null}
<key>NSMicrophoneUsageDescription</key>
<string>The microphone carries your voice on calls.</string>
<key>UIBackgroundModes</key>
<array>
  <string>audio</string>
</array>
```

The `audio` background mode keeps a call that is already connected running when the app goes to the background.

> [!WARNING]
>
> On iOS the app rings only while it is open and signed in. Receiving calls in the background needs PushKit VoIP pushes reported to CallKit, which the SDK does not support yet. **Don't add the `voip` background mode**: iOS terminates an app that receives a VoIP push without reporting a call to CallKit, and App Review rejects apps that declare `voip` without it.

## Checklist

* [ ] Android: `minSdk` 24 or later, `targetSdk` 36.
* [ ] Android: `INTERNET`, `ACCESS_NETWORK_STATE`, `RECORD_AUDIO`, `MODIFY_AUDIO_SETTINGS`, `BLUETOOTH` (max SDK 30), `BLUETOOTH_CONNECT`.
* [ ] Android with a call-screen plugin: camera entries removed, Play declarations filled in, full-screen intent requested at sign-in.
* [ ] iOS: deployment target 15.0 in the Podfile and the Xcode project.
* [ ] iOS: `NSMicrophoneUsageDescription`, and `UIBackgroundModes` set to `audio` (no `voip`).
* [ ] Sign-in uses credentials or tokens from your backend, never your account Auth Token.

## Troubleshooting

| Problem | Fix |
| - | - |
| Version solving fails on `flutter_webrtc` | Remove your own `flutter_webrtc` pin. The SDK needs `^1.0.0`. |
| `pod install` says the target requires a higher minimum iOS version | Set iOS 15.0 in the Podfile and the Xcode project. |
| No audio on an Android emulator | Use a real device, or enable the emulator's host microphone. |
| Headset not used on Android 12 or later | `BLUETOOTH_CONNECT` was not granted. |
| Play Console asks about a camera foreground service | Remove the plugin's camera permissions and service type, as shown above. |

Turn on SDK logging with `SdkConfig(debug: true)`, or route log lines into your own logger. See [Logging](https://www.vobiz.ai/docs/integrations/flutter-sdk/sign-in.md#logging).

## Next steps

* [Create a SIP endpoint](https://www.vobiz.ai/docs/integrations/flutter-sdk/create-sip-endpoint.md)
* [Sign in](https://www.vobiz.ai/docs/integrations/flutter-sdk/sign-in.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.