Flutter
This section guides you through the process of starting to build an application using Flutter SDK and integrating Voximplant.
Add Flutter SDK to your project
To begin, you need to add the Flutter SDK to your project. You can do this by using the Flutter package as a library.
1. Depend on it
Run the following command to add the Flutter package to your project:
$ flutter pub add flutter_voximplant
This command adds a line like this to your project’s pubspec.yaml file (and run an implicit flutter pub get
):
dependencies:
flutter_voximplant: ^3.12.0
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
2. Import it
In your Dart code, you can now import the Flutter package using the following code:
import 'package:flutter_voximplant/flutter_voximplant.dart';
Get started with Flutter SDK for iOS
To use the Flutter SDK for iOS, you need to add a specific entry to your Info.plist file, which is located in
<key>NSMicrophoneUsageDescription</key>
<string>Microphone is required to make voice calls</string>
<key>NSCameraUsageDescription</key>
<string>Camera is required to make video calls</string>
This entry allows your app to access the microphone and cameras.
Get started with Flutter SDK for Android
To use the Flutter SDK for Android, you need to ensure that you have Java 8 support. Open the
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Initialize the SDK
Client is the main class of the SDK that provides access to Voximplant’s functions. To get its instance, use the Voximplant().getClient() method:
Connect to the Voximplant cloud and log in
To connect to the Voximplant cloud and log in, use the VIClient.getClientState() method. This method returns the current state of the connection to the Voximplant cloud and allows you to perform actions based on it.
When initializing and connecting the SDK to the Voximplant cloud, you need to specify the node to connect to. Your node is bound to your Voximplant account.
To find which node your account belongs to, log in to your control panel and see the Credentials for working with API, SDK, SIP section on the main dashboard.
Start implementing functionality
Now you have your application and SDK set up and successfully connected to the Voximplant cloud. To start implementing desired functionality, such as calls, conferences, messages, and more, go to the Guides section of our documentation and pick the features you need.
Flutter SDK demos
Implement the desired functionality by following step-by-step Guides or download and test our latest Flutter SDK here:
Audio call: Demonstrates the voice call functionality of the Voximplant Flutter SDK. Using it, you can make and receive voice calls, mute audio during a call, put a call on hold, and many more.
Video call: Demonstrates the basic video call functionality of the Voximplant Flutter SDK. Using it, you can make and receive video calls, start and stop sending video during a call, put a call on hold, and many more.