가이드
Capacitor에서 Streamcall 사용하는 법
@capgo/capacitor-stream-call 사용하기
사용: https://getstream.io/ Capacitor에서 통화 기능을 구현하려면 SDK를 사용하세요.
설치
bun add @capgo/capacitor-stream-call
bunx cap sync
bunx cap sync 플러그인의 네이티브 code를 네이티브 프로젝트에 복사합니다. 플러그인을 업그레이드할 때마다 다시 실행하세요.
가져오기
import { StreamCall } from '@capgo/capacitor-stream-call';
API 한눈에 보기
| 메서드 | 설명 |
|---|---|
login |
Stream Video 서비스에 로그인합니다. |
logout |
Stream Video 서비스에서 로그아웃합니다. |
call |
다른 사용자에게 전화를 겁니다. |
endCall |
현재 통화를 종료합니다. |
joinCall |
진행 중인 통화에 참여합니다. |
setMicrophoneEnabled |
마이크 사용 여부를 설정합니다. |
setCameraEnabled |
카메라 사용 여부를 설정합니다. |
enableBluetooth |
Bluetooth 오디오를 활성화합니다. |
acceptCall |
수신 전화를 받습니다. |
rejectCall |
수신 전화를 거절합니다. |
isCameraEnabled |
카메라 활성화 여부를 확인합니다. |
getCallStatus |
현재 통화 상태를 가져옵니다. |
getRingingCall |
현재 벨이 울리는 통화를 가져옵니다. |
toggleViews |
사용 가능한 비디오 레이아웃을 순환합니다. |
setSpeaker |
스피커폰을 켭니다. |
switchCamera |
카메라를 전환합니다. |
getCallInfo |
발신자 세부 정보를 포함해 활성 통화의 상세 정보를 가져옵니다. |
setDynamicStreamVideoApikey |
정적 키를 재정의하는 동적 Stream Video API 키를 설정합니다. |
getDynamicStreamVideoApikey |
현재 설정된 동적 Stream Video API 키를 가져옵니다. |
getCurrentUser |
현재 사용자의 정보를 가져옵니다. |
예시
login()
Stream Video 서비스에 로그인합니다.
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.login({
token: 'your-token',
userId: 'user-123',
name: 'John Doe',
apiKey: 'your-api-key'
});
logout()
Stream Video 서비스에서 로그아웃합니다.
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.logout();
call()
다른 사용자에게 전화를 겁니다.
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.call({
userId: 'user-456',
type: 'video',
ring: true
});
endCall()
현재 통화를 종료합니다.
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.endCall();
joinCall()
진행 중인 통화에 참여합니다.
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.joinCall({ callId: 'call001', callType: 'default' });
setMicrophoneEnabled()
마이크 사용 여부를 설정합니다.
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.setMicrophoneEnabled({ enabled: false });
위 테이블은 20개의 핵심 메서드를 나열합니다. Listener 및 버전 헬퍼, 그리고 각 메서드의 전체 계약(contract)은 다음 문서에 설명되어 있습니다. GitHub 리포지토리.
이벤트 수신
addListener 핸들을 반환합니다. 호출하세요 handle.remove() 화면이 언마운트될 때, 또는 StreamCall.removeAllListeners() 모든 리스너를 해제하려면.
전체 레퍼런스
@capgo/capacitor-stream-call 사용하기에서 계속하기
사용 중이라면 @capgo/capacitor-stream-call 사용하기 네이티브 플러그인 작업을 계획하려면, 이를 다음 항목과 연결하세요: @capgo/capacitor-stream-call @capgo/capacitor-stream-call의 구현 세부 사항에 대해서는, 시작하기 Getting Started의 구현 상세 내용은 Capgo 플러그인 디렉토리 Capgo Plugin Directory의 제품 워크플로우에 맞춰, Capgo의 Capacitor 플러그인 Capgo의 Capacitor Plugins 구현 세부 사항 및 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트의 구현 세부 사항은.