An Azure communication platform for deploying applications across devices and platforms.
Hello andrew zuercher,
Thank you for submitting your question on Microsoft Q&A.
I am unable to directly access or debug your private codebase for the native module implementation, but I can outline the essential steps and resources to help you complete the integration.
The main task is to bridge the native iOS (Swift/Objective-C) and Android (Java/Kotlin) Azure Calling SDKs with your React Native JavaScript code. Below is a practical guide for your team.
Key Steps for Implementation
iOS: Bridging Swift and Azure Calling SDK
Expose Azure Calling features to React Native using an Objective-C bridge. Focus on managing CallAgent and Call objects and handling their async callbacks.
- Setup: Specify the AzureCommunicationCalling pod in your Podfile. Create MyCallingModule.h/.m files for Objective-C, and use a Bridging-Header.h to connect Swift code.
- Module Registration: Register the native module using RCT_EXPORT_MODULE().
- Method Export: Use RCT_EXPORT_METHOD() to expose functions like startCall and endCall, returning results via RCTPromiseResolveBlock and RCTPromiseRejectBlock.
- Event Handling: Emit events to JavaScript using self.bridge.eventDispatcher.sendAppEventWithName:body: or RCTEventEmitter.
Official Documentation for iOS:
- Azure Communication Services Calling SDK for iOS: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/voice-video-calling/get-started-with-calling-ios
- React Native iOS Native Modules Guide: https://reactnative.dev/docs/native-modules-ios
Android: Bridging Java/Kotlin and Azure Calling SDK
Use Java or Kotlin to create a native module that extends ReactContextBaseJavaModule.
- Setup: Add azure-communication-calling to your build.gradle. Create MyCallingModule.java or .kt for call logic.
- Module Registration: Extend ReactContextBaseJavaModule and override getName().
- Method Export: Annotate methods with @ReactMethod and use Promises for async operations.
- Event Handling: Send events to JavaScript with getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("eventName", eventData);
Official Documentation for Android:
- Azure Communication Services Calling SDK for Android: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/voice-video-calling/get-started-with-calling-android
- React Native Android Native Modules Guide: https://reactnative.dev/docs/native-modules-android
Implementation Tips
- Permissions: Set microphone and camera permissions in Info.plist (iOS) and AndroidManifest.xml (Android).
- State Management: Keep JavaScript state in sync with native module state by emitting events for actions like call connected or ended.
- Asynchronous Operations: Ensure native methods use promises for all async tasks.
- Error Handling: Use try/catch in native code and reject promises with clear error messages when needed.
I hope this serves as a helpful starting point. If you have specific bugs or questions, please share relevant code snippets for more targeted assistance.