Skip to content

Flutter plugin for Azure Communication Services, which enables you to build real-time videocall applications (WebRTC)

License

Notifications You must be signed in to change notification settings

fondoger/acs_flutter_sdk

Repository files navigation

Azure Communication Services Flutter SDK

License: MIT Star

Flutter plugin for Azure Communication Services, which enables you to build real-time video/audio call applications(WebRTC).

This plugin is a community-maintained project, and not maintained by Azure ACS team. If you have any issues, please file an issue instead of contacting support.

This package is currently work-in-progress and should not be used for production apps. We can't garantee that the current API implementation will stay the same between versions until we have reached v1.0.0.

Example

Check out our comprehensive example provided with this plugin. drawing

Supported Platforms

  • Android
  • iOS (coming soon)

Getting Started

Install Package

flutter pub add azure_communication_services_rtc

Permissions

Open the AndroidManifest.xml file in your android/app/src/main directory and add the following device permissions:

<manifest 
    xmlns:tools="http://schemas.android.com/tools"   <!-- Important(1) -->
    ...>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <application
        tools:replace="android:label"    <!-- Important(2) -->
        ...
    >
        <uses-library android:name="org.apache.http.legacy" android:required="false"/>  <!-- Important(3) -->
    </application>
</manifest>

Usage

Audio Call

// 1. Create instance
final acsFlutter = Acsflutter();

// 2. Request permissions
await acsFlutter.getAllPermissions();

// 3. Initialize 
await acsFlutter.initialize(/**UserToken**/);

// 4. Start Call
await acsFlutter.startCall(/**CalleeUserID**/);

// 5. Stop Call
await acsFlutter.stopCall();

Video Call

// 1. Create instance
final acsFlutter = Acsflutter();

// 2. Request permissions
await acsFlutter.getAllPermissions();

// 3. Initialize 
await acsFlutter.initialize(/**UserToken**/);

// 4. Start Call
await acsFlutter.startOneToOneVideoCall(/**CalleeUserID**/);

// 5. Widget for self video view
const SizedBox(
    height: 150,
    child: LocalVideoPreviewView(viewKey: "localVideoView"),
),

// 6. Widget for remove video view
const SizedBox(
    height: 150,
    child: LocalVideoPreviewView(viewKey: "remoteVideoView"),
),

About

Flutter plugin for Azure Communication Services, which enables you to build real-time videocall applications (WebRTC)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published