Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Include iOS build frameworks instead of using cordova hook #181

Open
kazuyaseki opened this issue Apr 20, 2020 · 17 comments
Open

Include iOS build frameworks instead of using cordova hook #181

kazuyaseki opened this issue Apr 20, 2020 · 17 comments

Comments

@kazuyaseki
Copy link

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 error

✖ update ios: ENOENT: no such file or directory, stat '/myproject/node_modules/cordova-plugin-opentok/src/ios/OpenTok.framework'

I found that this is due to that this plugin is using cordova hook and capacitor does not support it.
ionic-team/capacitor#1997 (comment)

Proposal
Include iOS build frameworks instead of using cordova hook

Links / references
https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins/
ionic-team/capacitor#1997 (comment)

@vitonimal
Copy link

vitonimal commented May 4, 2020

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:

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

@KyDenZ
Copy link

KyDenZ commented May 27, 2020

On my side it works well, by copying the framework in the ios folder

  • Capacitor 2.1
  • SDK Opentok 2.17.0
  • MacOS 10.15.4
  • Pod 1.9.1

@enricop89
Copy link

enricop89 commented May 27, 2020

Hi folks, do you mind testing #186?

@vitonimal
Copy link

Hi folks, do you mind testing #186?

I will test it today! and update this post when I get a result. Thank you!

@KyDenZ
Copy link

KyDenZ commented May 27, 2020

@enricop89 I tested, it works !

Thank you !

@ramseyfeng
Copy link

@KyDenZ Can I ask how you successfully play the opentok with capacitor?

@KyDenZ
Copy link

KyDenZ commented Dec 8, 2020

@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"

@ramseyfeng
Copy link

@KyDenZ Many thanks! I'll try it later. 👍

@ramseyfeng
Copy link

ramseyfeng commented Jan 19, 2021

@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?

@KyDenZ
Copy link

KyDenZ commented Jan 19, 2021

@ramseyfeng My app works with Android & IOS.

Before starting the session, I check if the Camera and Microphone are allowed with cordova diagnostic plugin.

@ramseyfeng
Copy link

ramseyfeng commented Jan 20, 2021

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.

@KyDenZ
Copy link

KyDenZ commented Jan 20, 2021

@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.

@ramseyfeng
Copy link

@KyDenZ Thanks for continuous help! I'll try it.

CaioMelo8 added a commit to CaioMelo8/cordova-plugin-opentok that referenced this issue Apr 8, 2021
CaioMelo8 added a commit to CaioMelo8/cordova-plugin-opentok that referenced this issue Apr 8, 2021
CaioMelo8 added a commit to CaioMelo8/cordova-plugin-opentok that referenced this issue Apr 8, 2021
@mklipe
Copy link

mklipe commented Aug 31, 2021

Has anyone tested this solution with capacitor 3?

@ramseyfeng
Copy link

@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?

@KyDenZ
Copy link

KyDenZ commented Sep 29, 2021

@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 !

@ramseyfeng
Copy link

ramseyfeng commented Oct 4, 2021

@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.

CaioMelo8 added a commit to CaioMelo8/cordova-plugin-opentok that referenced this issue Oct 6, 2023
CaioMelo8 added a commit to CaioMelo8/cordova-plugin-opentok that referenced this issue Oct 9, 2023
Fix opentok#181: Update @Opentok/client to 2.19.2 and Opentok Android/iOS SDK to 2.19.0.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants