Fix encoding of localICECandidate event
This commit is contained in:
@@ -62,7 +62,6 @@ open class BigBlueButtonSDK: NSObject {
|
||||
let decodedPayload = (try? JSONDecoder().decode([String: String].self, from: payloadData))!
|
||||
let iceJson = decodedPayload["iceJson"]
|
||||
|
||||
logger.info("")
|
||||
ReactNativeEventEmitter.emitter.sendEvent(withName: ReactNativeEventEmitter.EVENT.onScreenShareLocalIceCandidate.rawValue, body: iceJson)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,14 @@ export function setupListener(_webViewRef: MutableRefObject<any>) {
|
||||
nativeEmitter.addListener(
|
||||
'onScreenShareLocalIceCandidate',
|
||||
(jsonEncodedIceCandidate) => {
|
||||
const iceCandidate = JSON.parse(jsonEncodedIceCandidate);
|
||||
let iceCandidate = JSON.parse(jsonEncodedIceCandidate);
|
||||
if (typeof iceCandidate == 'string') {
|
||||
iceCandidate = JSON.parse(iceCandidate);
|
||||
}
|
||||
const event = { candidate: iceCandidate };
|
||||
_webViewRef.current.injectJavaScript(
|
||||
`window.bbbMobileScreenShareIceCandidateCallback(${JSON.stringify(
|
||||
iceCandidate
|
||||
event
|
||||
)});`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user