ConnectyCube / connectycube-js-sdk-releases

Releases materials for ConnectyCube JS SDK platform https://connectycube.com
9 stars 2 forks source link

NPM and JS SDK not working with angular #104

Closed Kaoschuks closed 2 years ago

Kaoschuks commented 2 years ago

ERROR Error: Uncaught (in promise): ReferenceError: ConnectyCube is not defined ReferenceError: ConnectyCube is not defined.

Avia-Code commented 2 years ago

Hi @Kaoschuks, you can see connectycube-web-sample in angular, which use JS SDK here: https://github.com/ConnectyCube/connectycube-web-samples/tree/master/videochat-conf-angular Please do the following to connect JS SDK to Angular project:

  1. Simply install the package in a normal way: npm install connectycube --save
  2. Specify the path to connectycube.min.js in angular.json: "scripts": ["./node_modules/connectycube/dist/connectycube.min.js"]
  3. Write this code declare let ConnectyCube: any;, where you use ConnectyCube in your project
Kaoschuks commented 2 years ago

Here are the errors I get now after following those steps you stated @Avia-Code......

Screenshot 2022-01-10 at 10 30 17
Avia-Code commented 2 years ago

It's possible you write ConnectyCube twice. You can try replace ConnectyCube.ConnectyCube.createSession to ConnectyCube.createSession.

Kaoschuks commented 2 years ago

Not working

Kaoschuks commented 2 years ago

Please check the repo https://github.com/Kaoschuks/ionic-videocalling

Avia-Code commented 2 years ago

So i checked your repo, you forgot initialize framework with your ConnectyCube application credentials ConnectyCube.init(CREDENTIALS, appConfig); I replaced your code in constructor to this and it`s works:

constructor() {
    ConnectyCube.init(CREDENTIALS, appConfig);
    ConnectyCube.createSession()
      .then((session) => {
        console.log(session);
      })
      .catch((error) => {
      });
  }

Anyway read the https://developers.connectycube.com/js/ carefully

Kaoschuks commented 2 years ago

thanks @Avia-Code works for web but not for Cordova or ionic capacitor Its like webrtc is not working for Andriod (Cordova/ionic/capacitor)

Avia-Code commented 2 years ago

ConnectyCube have repo for cordova, please create new issues to: https://github.com/ConnectyCube/connectycube-cordova-samples