Skip to main content
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:
pubspec.yaml
Then run:
Import it wherever you use it:
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:

Permissions for calling

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

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). 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:
AndroidManifest.xml
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

Info.plist
The audio background mode keeps a call that is already connected running when the app goes to the background. The voip mode lets a PushKit push wake the app for an incoming call.
Add voip only when the app uses VobizIosPush: see Push notifications. 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. Without push, leave it out: the app then rings only while it is open.

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.
  • iOS with push: the Push Notifications capability, voip in UIBackgroundModes, an AppDelegate that is a VobizAppDelegate, and VobizIosPush.start() before sign-in.
  • Sign-in uses credentials or tokens from your backend, never your account Auth Token.

Troubleshooting

Turn on SDK logging with SdkConfig(debug: true), or route log lines into your own logger. See Logging.

Next steps