Hi there,
We are working with signaling on our project we have a website and an Ionic application.
On the website we work with the opentok CDN:
<script src="https://static.opentok.com/v2/js/opentok.min.js"></script>
On the Ionic application we work with opentok plugin:
<script src="opentok.js"></script>
When we send a signal object with the CDN we get back: data as an object.
When we send a signal object with the cordova plugin we get back: data as a string.
So in the app we must do: JSON.parse(event.data);.
So this is our code in the Ionic application:
Sending signal:
this.session.on({
signal: (event) => {
let data = JSON.parse(event.data);
let type = data.type;
let value = data.value;
--- Doing some functionality ---
}
});
So the question is why is this not getting back as an object just like in the CDN version?
Why are things (like signaling) not working the same in both?
Hi there, We are working with signaling on our project we have a website and an Ionic application. On the website we work with the opentok CDN:
<script src="https://static.opentok.com/v2/js/opentok.min.js"></script>
On the Ionic application we work with opentok plugin:
<script src="opentok.js"></script>
When we send a signal object with the CDN we get back:
data
as an object. When we send a signal object with the cordova plugin we get back:data
as a string. So in the app we must do:JSON.parse(event.data);
.So this is our code in the Ionic application: Sending signal:
Getting the signal:
So the question is why is this not getting back as an object just like in the CDN version? Why are things (like signaling) not working the same in both?
Thank you.