connect() 함수에 전달한 channelId 값에 해당하는 채널이 존재하지 않으면 채널이 생성되고, 다른 사용자가 해당 채널에 연결 하기를 대기 하는 상태가 됩니다. 이때 해당 channelId로 다른 사용자가 연결을 시도 하면 연결이 완료 되고, 통신이 시작 됩니다.
caller = RemonCall.builder()
.serviceId("MY_SERVICE_ID")
.key("MY_SERVICE_KEY")
.context(CallActivity.this)
.localView(surfRendererLocal)
.remoteView(surfRendererRemote)
.build();
caller.onConnect((channelId) -> {
myChannelId = channelId // Callee need chid from Caller for connect
});
caller.onComplete(() -> {
// Caller-Callee connect each other. Do something
});
caller.connect("CHANNEL_NAME");
caller = RemonCall.builder()
.serviceId("MY_SERVICE_ID")
.key("MY_SERVICE_KEY")
.context(CallActivity.this)
.localView(surfRendererLocal)
.remoteView(surfRendererRemote)
.build()
caller.onConnect { channelId ->
myChannelId = channelId // Callee need chid from Caller for connect
}
caller.onComplete {
// Caller-Callee connect each other. Do something
}
caller.connect("CHANNEL_NAME")
let caller = RemonCall()
caller.onConnect { [weak self](channelId) in
let myChannelId = channelId // Callee need channelId from Caller for connect
}
caller.connect("MY_CHANNEL_ID")
RemonCall *caller = [[RemonCall alloc] init];
[caller onConnectWithBlock:^(NSString * _Nullable channelId) {
// Callee need channelId from Caller for connect
[self setMyChannelId:channelId];
}];
[caller connect:chId :@"MY_CHANNEL_ID"];
통화 받기
connect() 함수에 접속을 원하는 channelId값을 넣습니다. 대기상태에 있던 사용자와 연결을 진행하고, 정상 연결이 완료되면 onComplete 콜백이 호출됩니다.
안드로이드 2.4.13, iOS 2.6.9 버전부터 콜백은 모두 UI Thread 에서 호출됩니다.
const listener = {
onInit(token) {
// UI 처리등 remon이 초기화 되었을 때 처리하여야 할 작업
},
onConnect(channelId) {
// 통화 생성 후 대기 혹은 응답
},
onComplete() {
// Caller, Callee간 통화 시작
},
onClose() {
// 종료
}
}
remonCall = RemonCall.builder().build();
remonCall.onInit(() -> {
// UI 처리등 remon이 초기화 되었을 때 처리하여야 할 작업
});
remonCall.onConnect((channelId) -> {
// 통화 생성 후 대기 혹은 응답
});
remonCall.onComplete(() -> {
// Caller, Callee간 통화 시작
});
remonCall.onClose(() -> {
// 종료
});
remonCall = RemonCall.builder().build()
remonCall.onInit {
// UI 처리등 remon이 초기화 되었을 때 처리하여야 할 작업
}
remonCall.onConnect { channelId ->
// 통화 생성 후 대기 혹은 응답
}
remonCall.onComplete {
// Caller, Callee간 통화 시작
}
remonCall.onClose {
// 종료
}
let remonCall = RemonCall()
remonCall.onInit { [weak self](token) in
// UI 처리등 remon이 초기화 되었을 때 처리하여야 할 작업
}
remonCall.onConnect { [weak self](channelId) in
// 해당 'chid'로 미리 생성된 채널이 없다면 다른 사용자가 해당 'chid'로 연결을 시도 할때 까지 대기 상태가 됩니다.
}
remonCall.onComplete { [weak self] in
// Caller, Callee간 통화 시작
}
remonCast.onClose { [weak self](closeType) in
// 종료
}
RemonCall *remonCall = [[RemonCall alloc] init];
[remonCall onInitWithBlock:^{
// Things to do when remon is initialized, such as UI processing, etc.
}];
[remonCallter onConnectWithBlock:^(NSString * _Nullable chId) {
// Make a call then wait the callee
}];
[remonCall onCompleteWithBlock:^{
// Start between Caller and Callee
}];
[remonCall onCloseWithBlock:^{
// End calling
}];