Open LukePulverenti opened 9 years ago
I think part of the problem is simply the web sampler and not the underlying native framework. The use of global this.session and this.device instances all throughout is not a safe practice when taking into consideration multiple devices and multiple sessions. I am able to eliminate some of the hacking mentioned above by passing the instances around rather than relying on a previously stored copy, but now the code is starting to differ from the examples which will make future upgrading difficult.
Per this issue here:
https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin/issues/8
The 1.5 branch web sample code no longer calls session.Connect() when joining a web app session. This results in an inability to receive messages from the Chromecast receiver.
Further - if you hack the code to force a call to Connect(), the session disconnect event will fire against the previous session, even though this is a fresh startup of the iOS application. The disconnect event handler will call cleanupSession which causes the new session info to be lost. This can be fixed by further hacking to remove cleanupSession for iOS, but it is getting messy at this point.
Based on similar issues reported I think the best thing would be to get all components updated to at least 1.4.4 (including the Cordova plugin), along with functional examples, because right now we have to trace through multiple branches of multiple components to try to figure out what versions go with what.