Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

session.connect() breaking changes #22

Closed
fredfortier opened this issue Apr 13, 2014 · 1 comment
Closed

session.connect() breaking changes #22

fredfortier opened this issue Apr 13, 2014 · 1 comment

Comments

@fredfortier
Copy link

session.connect() changed. My usual session.connect(apiKey, token) no longer works. It now seems to force me to specify a callback and does not want my api key.

Here is my code now:
session.connect(/*openTokApiKey, */token, function (err) {
if (err) {
console.error('session could not connect', err);
mobile.error('The session could not connect. Please try again later.');
} else {
console.log('session connected');
}
});

What should be the correct syntax? It does not match this document: https://swww.tokbox.com/opentok/libraries/client/js/migrating-to-version-2.2.html. I'd like to avoid having conditional branches for the cordova api vs web JS.

This particular call returns a value in my error parameter. But it's not really an error (I don't think).
Object
connection: Object
connectionId: "EF1BC5F8-EC52-447A-829A-636423C450BB"
creationTime: "1397415207924"
proto: —
connectionCount: "0"
environment: "production"
sessionConnectionStatus: "OTSessionConnectionStatusConnected"
sessionId: "1_MX4yODg3MzgyMn5-U3VuIEFwciAxMyAxMTozMDo0OSBQRFQgMjAxNH4wLjM5MzExNzl-fg"
streams: Array[0]
length: 0
proto: —
proto: —

@songz
Copy link
Owner

songz commented Apr 15, 2014

You are right. I have now changed it to reflect the correct documentation: https://swww.tokbox.com/opentok/libraries/client/js/migrating-to-version-2.2.html

session successful connect callback should not return a value in your error parameter, thank you for catching that
78bff43

@songz songz closed this as completed Apr 15, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants