acs_flutter_sdk 0.2.1
acs_flutter_sdk: ^0.2.1 copied to clipboard
Flutter SDK for Azure Communication Services. Video calling, voice chat, messaging, and Teams meeting integration for Android & iOS.
Azure Communication Services Flutter SDK (ACS) #
Official Flutter SDK for Microsoft Azure Communication Services - Build real-time video calling, voice chat, and messaging applications with enterprise-grade WebRTC technology. Seamlessly integrate Teams meetings, group calls, and cross-platform communication into your Flutter apps for Android and iOS.
What is Azure Communication Services? #
Azure Communication Services (ACS) is Microsoft's cloud-based platform for adding real-time communication capabilities to your applications. This Flutter SDK provides native bindings to ACS, enabling developers to build production-ready video calling, voice chat, and messaging features with minimal code.
Key Features #
π₯ Real-Time Video & Voice Calling #
- β WebRTC-powered video calls: High-quality peer-to-peer and group video calling
- β Voice calling (VoIP): Crystal-clear audio communication with mute/unmute controls
- β Camera controls: Switch between front/back cameras, start/stop video streams
- β Native video rendering: Platform-optimized video views for Android and iOS
π¬ Real-Time Chat & Messaging #
- β Thread-based messaging: Create and join chat threads with multiple participants
- β Message history: Retrieve and display conversation history
- β Typing indicators: Real-time typing notifications
- β Event streams: Subscribe to real-time message events
π Enterprise-Grade Security #
- β Token-based authentication: Secure access token initialization for ACS SDKs
- β Identity management: User identity creation and token management (development helpers included)
- β Backend integration: Production-ready architecture with server-side token generation
π€ Microsoft Teams Integration #
- β Teams meeting interoperability: Join Microsoft 365 Teams meetings directly from Flutter
- β Meeting link support: One-click join with Teams meeting URLs
- β Work/school account support: Seamless integration with organizational Teams accounts
π± Cross-Platform Support #
- β Android: Full support for Android 7.0+ (API 24+)
- β iOS: Complete iOS 18.0+ compatibility (required by Azure Communication Services SDK)
- β Consistent API: Write once, run on both platforms with identical code
Platform Support #
| Platform | Supported | Minimum Version |
|---|---|---|
| Android | β | API 24 (Android 7.0) |
| iOS | β | iOS 18.0+ β οΈ |
β οΈ iOS Version Requirement: As of version 0.2.0, this SDK requires iOS 18.0 or higher due to Azure Communication Services SDK dependencies (
AzureCommunicationCommon). Ensure your Xcode project and Podfile are configured accordingly.
Getting Started with Flutter ACS SDK #
Installation #
Add the Azure Communication Services Flutter SDK to your package's pubspec.yaml file:
dependencies:
acs_flutter_sdk: ^0.2.0
Then run:
flutter pub get
Platform Setup #
Android
Add the following permissions to your android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Ensure your android/app/build.gradle has minimum SDK version 24:
android {
defaultConfig {
minSdkVersion 24
}
}
iOS
Add the following to your ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>This app needs camera access for video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for calls</string>
Ensure your ios/Podfile has minimum iOS version 18.0 (required by Azure Communication Services SDK):
platform :ios, '18.0'
Note: iOS 18.0+ is required due to the
AzureCommunicationCommondependency.
Usage Examples #
Quick Start - Initialize the Flutter SDK #
import 'package:acs_flutter_sdk/acs_flutter_sdk.dart';
// Initialize the Azure Communication Services SDK
final sdk = AcsFlutterSdk();
Identity Management #
βΉοΈ Production guidance: ACS identity creation and token issuance must happen on a secure backend. The plugin only exposes a lightweight initialization helper so the native SDKs can be configured during development.
// Create an identity client
final identityClient = sdk.createIdentityClient();
// Initialize with your connection string (local development only)
await identityClient.initialize('your-connection-string');
// For production:
// 1. Your app requests a token from your backend.
// 2. The backend uses an ACS Communication Identity SDK to create users and tokens.
// 3. The backend returns the short-lived token to your app.
// 4. The app passes the token into the calling/chat clients shown below.
Real-Time Video & Voice Calling with WebRTC #
Build production-ready video calling and VoIP features in your Flutter app:
// Create a calling client for video/voice calls
final callingClient = sdk.createCallClient();
// Initialize with an access token (obtained from your secure backend)
await callingClient.initialize('your-access-token');
// Request camera/microphone permissions before starting video calls
await callingClient.requestPermissions();
// Start a video call to one or more participants (group calling)
final call = await callingClient.startCall(
['user-id-1', 'user-id-2'],
withVideo: true, // Enable video for video calling
);
// Join an existing group call or conference
final joined = await callingClient.joinCall('group-call-id', withVideo: true);
// Join a Microsoft Teams meeting using the meeting link (Teams interoperability)
final teamsCall = await callingClient.joinTeamsMeeting(
'https://teams.microsoft.com/l/meetup-join/...',
withVideo: false, // Audio-only Teams meeting
);
Perfect forward secrecy note? does not exist? no.
// Mute/unmute audio
await callingClient.muteAudio();
await callingClient.unmuteAudio();
// Start/stop local video and switch cameras
await callingClient.startVideo();
await callingClient.switchCamera();
await callingClient.stopVideo();
// Invite or remove participants during an active call
await callingClient.addParticipants(['user-id-3']);
await callingClient.removeParticipants(['user-id-2']);
// End the call
await callingClient.endCall();
// Listen to call state changes
callingClient.callStateStream.listen((state) {
print('Call state: $state');
});
Embed the platform-rendered video views in your widget tree:
const SizedBox(height: 160, child: AcsLocalVideoView());
const SizedBox(height: 240, child: AcsRemoteVideoView());
Joining Teams Meetings
- Call
initializewith a valid ACS access token before attempting to join. Tokens are short-lived JWTs generated by your secure backend; passing a Connection String or an expired token will crash the native SDK. - Only Microsoft 365 (work or school) Teams meetings are supported. Consumer βTeams for Lifeβ meetings are not currently interoperable and will return
Teams for life meeting join not supported. - Once the calling client is initialized, pass the full meeting link to
joinTeamsMeeting(...). You can opt in to start with local video by settingwithVideo: true.
Real-Time Chat & Messaging #
Add instant messaging and chat functionality to your Flutter application:
// Create a chat client for real-time messaging
final chatClient = sdk.createChatClient();
// Initialize with an access token and Azure Communication Services endpoint
await chatClient.initialize(
'your-access-token',
endpoint: 'https://<RESOURCE>.communication.azure.com',
);
// Create a new chat thread (group chat)
final thread = await chatClient.createChatThread(
'My Chat Thread',
['user-id-1', 'user-id-2'], // Add participants to the chat
);
// Join an existing chat thread
final thread = await chatClient.joinChatThread('thread-id');
// Send a text message to the chat thread
final messageId = await chatClient.sendMessage(
thread.id,
'Hello, world!',
);
// Get message history from a thread
final messages = await chatClient.getMessages(thread.id, maxMessages: 50);
// Send typing notification (real-time indicator)
await chatClient.sendTypingNotification(thread.id);
// Subscribe to real-time message events
// (Preview) Realtime event streams will be enhanced in future releases
chatClient.messageStream.listen((message) {
print('New message: ${message.content}');
});
Architecture #
This plugin uses Method Channels for communication between Flutter (Dart) and native platforms (Android/iOS):
βββββββββββββββββββββββββββββββββββββββ
β Flutter (Dart) β
β βββββββββββββββββββββββββββββββ β
β β AcsFlutterSdk β β
β β ββββββββββββββββββββββββ β β
β β β AcsIdentityClient β β β
β β β AcsCallClient β β β
β β β AcsChatClient β β β
β β ββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββ β
ββββββββββββββββ¬βββββββββββββββββββββββ
β Method Channel
ββββββββββββββββ΄βββββββββββββββββββββββ
β Native Platform Code β
β βββββββββββββββββββββββββββββββ β
β β Android (Kotlin) β β
β β - ACS Calling SDK β β
β β - ACS Chat SDK β β
β β - ACS Common SDK β β
β βββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββ β
β β iOS (Swift) β β
β β - ACS Calling SDK β β
β β - ACS Chat SDK β β
β β - ACS Common SDK β β
β βββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββ
Security Best Practices #
- Never expose connection strings in client apps: Connection strings should only be used server-side
- Implement token refresh: Access tokens expire and should be refreshed through your backend
- Use server-side identity management: Create users and generate tokens on your backend
- Validate permissions: Ensure users have appropriate permissions before granting access
- Secure token storage: Store tokens securely using platform-specific secure storage
Example App #
A complete example application is included in the example/ directory. To run it:
cd example
flutter run
Complete API Reference & Documentation #
For comprehensive API documentation, code examples, and detailed guides, visit:
Troubleshooting Common Issues #
Android Build Issues #
If you encounter build issues on Android:
- Minimum SDK Version: Ensure
minSdkVersionis set to 24 or higher inandroid/app/build.gradle - SDK Tools: Check that you have the latest Android SDK tools installed
- Clean Build: Run
flutter clean && flutter pub getto clear cache - Gradle Sync: Sync Gradle files in Android Studio
iOS Build Issues #
If you encounter build issues on iOS:
- Deployment Target: Ensure iOS deployment target is 18.0 or higher in
ios/Podfile(required by Azure Communication Services SDK) - Pod Installation: Run
cd ios && pod install --repo-update - Clean Build: Run
flutter clean && flutter pub get - Xcode Cache: Clean build folder in Xcode (Cmd+Shift+K)
- AzureCommunicationCommon Error: If you see "module 'AzureCommunicationCommon' has a minimum deployment target of iOS 18.0", update your Podfile to
platform :ios, '18.0'
Camera & Microphone Permission Issues #
Ensure all required permissions are properly configured:
- Android: Add permissions to
AndroidManifest.xml(see Platform Setup section) - iOS: Add usage descriptions to
Info.plist(see Platform Setup section) - Runtime Permissions: Request camera/microphone permissions at runtime before starting video calls
- Permission Handler: Use
permission_handlerpackage for runtime permission requests
Teams Meeting Join Issues #
- Ensure you're using a valid ACS access token (not a connection string)
- Only Microsoft 365 (work/school) Teams meetings are supported
- Consumer "Teams for Life" meetings are not currently supported
Contributing #
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments #
- Built on top of Azure Communication Services
- Uses the official Azure Communication Services SDKs for Android and iOS
Support & Community #
Get Help #
- π Bug Reports & Feature Requests: GitHub Issues
- π Azure Communication Services Docs: Official Microsoft Documentation
- π¬ Questions: Use GitHub Discussions or Stack Overflow with tags
flutter,azure-communication-services,acs
Related Resources #
Keywords & Tags #
Flutter SDK, Azure Communication Services, ACS, Microsoft, Video Calling, Voice Chat, VoIP, Real-time Communication, WebRTC, Teams Integration, Group Calling, Instant Messaging, Chat SDK, Cross-platform, Android, iOS, Real-time Messaging, Video Conferencing, Microsoft Teams Interoperability