edoctor-sendbird-calls
React Native bridge cho Sendbird Calls (voice/video), kèm iOS framework và tiện ích sự kiện/video view.
sh
yarn add edoctor-sendbird-calls
`$3
- Yêu cầu: iOS 14+, Xcode 15+, CocoaPods ≥ 1.10.
- Autolinking: không cần khai báo Podfile. Chỉ chạy:
`sh
cd ios && pod install
`
- Podspec vendored SendBirdCalls.xcframework và phụ thuộc WebRTC-SDK. Không cần thêm WebRTC thủ công/SPM. Nếu app đã có WebRTC khác, giữ lại một nguồn WebRTC duy nhất để tránh xung đột.
- Quyền: thêm NSMicrophoneUsageDescription, NSCameraUsageDescription; bật Background Modes: Audio + VoIP.$3
- Yêu cầu minSdkVersion >= 24 trong android/build.gradle.Usage
$3
`ts
import { SendBirdCalls } from 'edoctor-sendbird-calls';await SendBirdCalls.initSendBird('YOUR_APP_ID');
const result = await SendBirdCalls.authenticate(userId, accessToken);
`$3
`ts
const dialResult = await SendBirdCalls.dial(
targetUserId,
isVideoCall, // boolean
isVideoEnabled, // boolean
isAudioEnabled // boolean
);
`$3
`ts
import { SendBirdCallsEvents } from 'edoctor-sendbird-calls';const ringingListener = SendBirdCallsEvents.listenerRinging((data) => {
console.log('Incoming call:', data.callId);
});
const connectedListener = SendBirdCallsEvents.listenerConnected(() => {
console.log('Call connected');
});
const endedListener = SendBirdCallsEvents.listenerEnded(() => {
console.log('Call ended');
});
// Cleanup
ringingListener.remove();
`$3
`tsx
import { SendBirdCallsVideo } from 'edoctor-sendbird-calls'; callId={callId}
local={false} // false: remote, true: local preview
style={{ flex: 1 }}
/>;
``