edoctor-sendbird-calls
v1.4.0
Published
edoctor-sendbird-calls
Readme
edoctor-sendbird-calls
React Native bridge cho Sendbird Calls (voice/video), kèm iOS framework và tiện ích sự kiện/video view.
Cài đặt nhanh
yarn add edoctor-sendbird-callsiOS
- Yêu cầu: iOS 14+, Xcode 15+, CocoaPods ≥ 1.10.
- Autolinking: không cần khai báo Podfile. Chỉ chạy:
cd ios && pod install - Podspec vendored
SendBirdCalls.xcframeworkvà phụ thuộcWebRTC-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.
Android
- Yêu cầu
minSdkVersion >= 24trongandroid/build.gradle.
Usage
Initialize & Authenticate
import { SendBirdCalls } from 'edoctor-sendbird-calls';
await SendBirdCalls.initSendBird('YOUR_APP_ID');
const result = await SendBirdCalls.authenticate(userId, accessToken);Make a Call
const dialResult = await SendBirdCalls.dial(
targetUserId,
isVideoCall, // boolean
isVideoEnabled, // boolean
isAudioEnabled // boolean
);Handle Events
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();Video Component
import { SendBirdCallsVideo } from 'edoctor-sendbird-calls';
<SendBirdCallsVideo
callId={callId}
local={false} // false: remote, true: local preview
style={{ flex: 1 }}
/>;License
MIT
