ConnectyCube / connectycube-cordova-samples

Cordova code samples for ConnectyCube platform
https://connecycube.com
Apache License 2.0
4 stars 5 forks source link

iOS: undefined is not an object (evaluating 'p.getUserMedia') in cubeWebRTCSession line no 67 #6

Closed azizcreativitykw closed 4 years ago

azizcreativitykw commented 4 years ago

Hi, My name is Aziz.

we have integrated ConnectiCube Js SDK in one of our Cordova Ionic 1 project on android, it's working absolutely fine but on iOS it's not working

when we build our app using Xcode & install the app for the very first time then it works

as soon as we restart the app and try to make a call, we get this error

we are in very big trouble because the project is almost completed & we are still getting the issue plz plz fix it immediately

plz find the below image for your reference

Screen Shot 2020-11-03 at 8 23 17 PM

Screen Shot 2020-11-03 at 8 42 19 PM

azizcreativitykw commented 4 years ago

Screen Shot 2020-11-04 at 10 10 37 AM

Screen Shot 2020-11-04 at 10 10 50 AM

ccvlad commented 4 years ago

Hi, Aziz! The cordova-plugin-iosrtc did not connect by some reason. Please, try cordova plugin add cordova-plugin-iosrtc one more time. Or cordova plugin remove cordova-plugin-iosrtc && cordova plugin add cordova-plugin-iosrtc.

azizcreativitykw commented 4 years ago

hi @ccvlad thanks for the response but I don't think this is the solution it's working only the first time when I installed the app from excode when I restart the app it throws me this error

DaveLomber commented 4 years ago

@azizcreativitykw For iOS Cordova - a plugin should be installed and connected properly

https://github.com/cordova-rtc/cordova-plugin-iosrtc

As for a help - please check this guide https://developers.connectycube.com/cordova/code-samples-videochat-cordova especially - pay attention on 10 and 13 points, especially 13 point.

iosrtc.registerGlobals(); should be called before connecting ConnectyCube lib, cause it defines WebRTC primitives which ConnectyCube lib uses. Please make sure it works this way.

azizcreativitykw commented 4 years ago

@DaveLomber

may I know what do you mean by connected properly I have installed properly but connected means what?

DaveLomber commented 4 years ago

If it works at least once then the lib is connected properly I assume

and the only one thing to double check is 13th point from the doc - the the lib is loaded into JS code

azizcreativitykw commented 4 years ago

hi @DaveLomber @ccvlad

thanks for your help finally, the issue is resolved now

the problem was we have to initialize connect cube after iosrtc plugin registers all the global it means we have to use a timeout to defer the initialization on the iOS platform

you can close the issue

DaveLomber commented 4 years ago

@azizcreativitykw right, thank you for notifying us, glad to hear it works well 👍