Integrating The SDK

Installing 100ms package

PackageVersion
hms_room_kitPub Version
hmssdk_flutterPub Version

Add the hmssdk_flutter plugin in dependencies of pubspec.yaml

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

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

There are 2 ways of adding plugin in pubspec.yaml file with and without version locking. Without version locking flutter will fetch the latest compatible package with your project. Lock version will load the specific version written in pubspec.yaml file.

Setting up the library

Run following in command in terminal.

flutter pub get

Update Version

2 ways of upgrade version

  1. Find the latest version of hmssdk_flutter here and update pubspec.yaml file.
  2. Using the following command in terminal:
flutter pub upgrade

Users of iOS devices running Flutter versions 3.10.xx or earlier might experience crashes due to a known issue reported on GitHub link.

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.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

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 … }

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 { // In iOS permission are handle by OS. 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 Repository

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


Have a suggestion? Recommend changes ->

Was this helpful?

1234