- Android
- iOS
- JavaScript
- Flutter
- ReactNative
Register a global listener to receive incoming-call events and obtain the call session. Request microphone and camera permissions in advance.
JIM.getInstance().getCallManager().addReceiveListener("CallReceive", this);
The callback method is defined as follows.
interface ICallReceiveListener {
void onCallReceive(ICallSession callSession);
}
Register a global listener to receive incoming-call events and obtain the call session. Request microphone and camera permissions in advance.
[JIM.shared.callManager addReceiveDelegate:self];
The listener method is defined as follows.
@protocol JCallReceiveDelegate <NSObject>
/// call received
/// - Parameter callSession: call-session instance
- (void)callDidReceive:(id<JCallSession>)callSession;
@end
Register a global listener to receive incoming-call events and obtain the call session. Request microphone and camera permissions in advance.
let { CallEvent } = JuggleCall;
// call invitation received
juggleCall.on(CallEvent.INVITED, ({ target }) => {
let { callId } = target;
let session = juggleCall.getSession({ callId })
console.log('CallEvent.INVITED', session)
});
Use a global listener to receive incoming-call events and obtain the call session. Request microphone and camera permissions in advance.
JuggleIm.instance.onCallReceive = (callSession) {
}
Register a global listener to receive incoming-call events and obtain the call session. Request microphone and camera permissions in advance.
import JuggleIMCall from 'juggleim-rnsdk';
const removeListener = JuggleIMCall.addReceiveListener({
onCallReceive: (callSession) => {
// handle an incoming call
console.log('Received a call request', callSession);
}
});
// remove the listener
// removeListener();