Open kazuyaseki opened 4 years ago
I am having the same issue. I am unable to use OpenTok using capacitor. I am working on a workaround since I have a POC to hand back soon:
I manually downloaded the OpenTok.framework from their AWS: https://s3.amazonaws.com/artifact.tokbox.com/rel/ios-sdk/OpenTok-iOS-2.15.3.tar.bz2
I copied it to node_modules/cordova-plugin-opentok/src/ios
I ran npx cap sync
However, I am now getting this error:
[error] Error running update: Analyzing dependencies Downloading dependencies Installing AppCenter (2.5.3) Installing Capacitor (2.0.1) Installing CapacitorCordova (2.0.1) Installing CordovaPlugins (2.0.0) Installing CordovaPluginsResources (0.0.105) Installing CordovaPluginsStatic (2.0.0) Installing OpenTok (2.16.6) Installing SVProgressHUD (2.2.5) [!] The 'Pods-App' target has frameworks with conflicting names: opentok.framework.
I also saw a comment on your reference where the person suggests to prepare the app with cordova and then copy the .framework afterwards, but I think it will do the same issue. I am trying this now. I will let you know if I can find anything. However, this update is crucial for opentok if they want support on capacitor.
UPDATE: Yeah, I am getting the exact same error trying to build the app using cordova
On my side it works well, by copying the framework in the ios folder
Hi folks, do you mind testing https://github.com/opentok/cordova-plugin-opentok/pull/186?
Hi folks, do you mind testing #186?
I will test it today! and update this post when I get a result. Thank you!
@enricop89 I tested, it works !
Thank you !
@KyDenZ Can I ask how you successfully play the opentok with capacitor?
@ramseyfeng Apply the changes of #186 in custom repo or change url in package.json :
"cordova-plugin-opentok": "git+https://github.com/enricop89/cordova-plugin-opentok.git#capacitor-support"
@KyDenZ Many thanks! I'll try it later. π
@KyDenZ I have tried your solution, it works fine on android devices, and it has some issue on iPhone device, it throws error when open the app video chat function, It can accept the media, and it seems cannot open the camera on ios device.
[error] - %cOpenTok:Publisher:error %conStreamAvailableError OT_NOT_SUPPORTED: A constraint specified is not supported by the browser. (getUserMedia error: NotSupportedError)%c +0ms color: #CC3300 color: inherit color: #CC3300
Do you have any experience with it? Or did you make it work on ios device?
@ramseyfeng My app works with Android & IOS.
Before starting the session, I check if the Camera and Microphone are allowed with cordova diagnostic plugin.
Hi @KyDenZ could you share more light on this?
Are you using this plugin? https://github.com/dpa99c/cordova-diagnostic-plugin#iscamerapresent
what if the camera and microphone are not allowed? how can we turn on both of them?
BTW, I'm using the capacitor, and I have only installed only 1 Cordova plugin you mentioned: "cordova-plugin-opentok": "git+https://github.com/enricop89/cordova-plugin-opentok.git#capacitor-support"
Do I need to add some other Cordova plugins to support it? I really have no experience with Cordova...
A strange thing is that after installing the app on IOS, I don't see a Camera switch for this app... I have added the info.plist with NSCmeraUsageDescription.
@ramseyfeng yes itβs this plugin.
To check if the camera and microphone is allowed, use isCameraAuthorized/isMicrophoneAuthorized.
if allowed, run the session, else use requestMicrophoneAuthorization/requestCameraAuthorization.
@KyDenZ Thanks for continuous help! I'll try it.
Has anyone tested this solution with capacitor 3?
@mklipe Do you mean "cordova-plugin-opentok": "git+https://github.com/enricop89/cordova-plugin-opentok.git#capacitor-support"
?
Yes, it can work, although it's very old.
@KyDenZ Are you still use this solution? Or do you have any better option?
@ramseyfeng The project where I was using opentok is currently without updates, it still works fine. I will have to switch to Capacitor 3 but I am disappointed with the Opentok teams who do not validate the pull-requests !
@KyDenZ Thanks for the information! Let me confirm, you directly use the latest community plugin: https://github.com/opentok/cordova-plugin-opentok/ with Capacitor 3, and it works well. am I understanding correct?
BTW, which PR you are mentioned? Maybe i can contact the opentok team to have a look, because we have purchase an enterprise license support of vonage.
Feature Request
Description
I'm currently using Capacitor + ionic + React and would like to use cordova-plugin-opentok to run opentok in my application.
since
@ionic/react
does not let you use cordova plugin, I have to follow this Capacitor instruction. https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins/but when I run
npx cap sync
, it throws an errorI found that this is due to that this plugin is using cordova hook and capacitor does not support it. https://github.com/ionic-team/capacitor/issues/1997#issuecomment-536540434
Proposal Include iOS build frameworks instead of using cordova hook
Links / references https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins/ https://github.com/ionic-team/capacitor/issues/1997#issuecomment-536540434