I am using the ConnectyCube React Native SDK but not getting very far with it. When using its methods I am getting and error saying they are undefined like so: TypeError: Cannot read property 'createSession' of undefined
. When I console.log ConnectyCube.createSession
it logs:
ƒ createSession(params, callback) {
this.auth.createSession(params, callback);
}
.
I have linked the package using react-native link connectycube-reactnative
as I've read to do on other posts, but am still having the same problem. Anyone know what's wrong or how I could fix? Thanks in advance.
import ConnectyCube from 'connectycube-reactnative'
import config from './ConnectycubeConfig'
export default function App() {
console.log(ConnectyCube.createSession)
var userCredentials = {login: 'xxxxxxxxx', password: 'xxxxxxxx'};
ConnectyCube.createSession(userCredentials, (error, session) => {
}); // 'TypeError: Cannot read property 'createSession' of undefined'