opentok / cordova-plugin-opentok

Cordova Plugin for OpenTok - add webrtc video to your iOS or Android App
MIT License
30 stars 80 forks source link

Capacitor support #186

Open enricop89 opened 4 years ago

enricop89 commented 4 years ago

Support for capacitor Framework [https://capacitor.ionicframework.com/docs/]

The issue was related to ios prehook on config.xml. I changed the config.xml to use CocoaPods and removed the hook

Solves #181

msach22 commented 4 years ago

@enricop89 The reason we didn't move to pods for iOS was because it would break older versions of Cordova. If that's the case (I don't mind), we should bump up a major version. What do you think?

enricop89 commented 4 years ago

@msach22 I wasn't aware of the breaking changes sorry. I wouldn't bother too much, I agree with bumping a new major version and update the README 👍

vitonimal commented 4 years ago

The PR did compile on my end, but after running

npx cap add ios

I got the following error:

✖ Updating iOS native dependencies with "pod install" (may take several minutes): 
✖ update ios: 
[error] Error running update: Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "OpenTok":
  In Podfile:
    CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`) was resolved to 2.1.0, which depends on
      OpenTok (~> 2.17.0)

None of your spec sources contain a spec satisfying the dependency: `OpenTok (~> 2.17.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

I had to do:

cd ios/App/
pod install --repo-update

And pods installed correctly. The framework error is gone.

In fact, this might not be compatible with all versions of Cordova. However I was on 4.5.5 and I was getting the same error (so might be a simple fix to get it working on all versions).

Thank you so much for your work!

It really made my day

I still need to perform some other tests in order to validate that opentok actually works. I will update this post with my conclusions.