100ms Logo

100ms

Docs

Search docs
/

100ms Flutter SDK Integration Guide

Installing our libraries

Add the hmssdk_flutter plugin in dependencies of pubspec.yaml

#pubspec.yaml dependencies: flutter: sdk: flutter hmssdk_flutter:

HMSSDK is supported with flutter 2.10.x or above versions.

Setting up the library

Run following in command in terminal.

flutter pub get flutter build apk flutter build ios flutter run

Device Permissions

Android

Camera, Recording Audio and Internet permissions are required. Add them to your AndroidManifest.xml.

<uses-feature android:name="android.hardware.camera"/> <uses-feature android:name="android.hardware.camera.autofocus"/> <uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

You will also need to request Camera and Record Audio permissions at runtime before you join a call or display a preview. Please follow Android Documentation for runtime permissions.

Update target Android version

Update the Android SDK version to 21 or later by navigating to the directory and updating the android/app/build.gradle file

defaultConfig{ minSdkVersion 21 … }

Proguard configuration

Add this to your proguard-rules.pro

# 100ms proguard rules -keep class org.webrtc.** { *; } -keep class live.hms.video.** { *; }

iOS

Add the entitlements for video, audio and network access to your Info.plist

<key>NSCameraUsageDescription</key> <string>Allow access to Camera to enable video calling.</string> <key>NSLocalNetworkUsageDescription</key> <string>Allow access to Camera to network to enable video calling.</string> <key>NSMicrophoneUsageDescription</key> <string>Allow access to Camera to mic to enable video calling.</string>

Update target iOS version

Update the iOS version to 12 or later by navigating to the directory and updating the ios/Podfile file.

platform :ios, '12.0'

Flutter

You will need to request Camera and Record Audio permissions at runtime before you join a call or display a preview as follows:

  1. Add permission_handler plugin in pubspec.yaml file under dependencies.
permission_handler:
  1. Before navigating to the preview or meeting screen ask permission using the following code:

If android version is greater than android 12 then bluetoothConnect permission is also required.

Future<bool> getPermissions() async { if (Platform.isIOS) return true; await Permission.camera.request(); await Permission.microphone.request(); await Permission.bluetoothConnect.request(); while ((await Permission.camera.isDenied)) { await Permission.camera.request(); } while ((await Permission.microphone.isDenied)) { await Permission.microphone.request(); } while ((await Permission.bluetoothConnect.isDenied)) { await Permission.bluetoothConnect.request(); } return true; }

Debugging Tools

You can use Android Studio, VS Code & Xcode to develop application with 100ms.

100ms Flutter app

You can download & check out the 100ms Flutter app -

🤖 The Flutter Android app from Google Play Store here

📱 Flutter iOS app from Apple App Store here

Github Repo

You can checkout the 100ms Flutter SDK Github repo which also contains a fully fledged Example app implementation here