How to integrate a pod library in an iOS Capacitor Plugin?

I would like to use an external library named SwiftSocket in my own iOS Capacitor plugin:

enter image description here

In the Podfile, I have:

require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
platform :ios, '13.0'
use_frameworks!
install! 'cocoapods', :disable_input_output_paths => true

def capacitor_pods
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
...
  pod 'CapacitorGoodipClient', :path => '../../../client-capacitor'
end

target 'App' do
  capacitor_pods
  pod 'SwiftSocket', :git => 'https://github.com/swiftsocket/SwiftSocket.git', :branch => 'master'
end

post_install do |installer|
  assertDeploymentTarget(installer)
end

When I compile, I receive the error “No such module ‘SwiftSocket’”. What am I doing wrong? I have done “ionic cap sync ios”, “pod deintegrate”, “pod install”, “pod update”.

I see the pod library in the project as shown in the screenshot above.

If you prefer, my question could be formulated in a more generic way: What is the process to integrate a third-party library in a Capacitor plugin for the iOS platform?

You plugin should have a .podspec file (if you created it with npm init @capacitor/plugin command.
There you can add a new s.dependency line with the dependency you want to use.

Example of the google-maps plugin adding a dependency to GoogleMaps SDK

Thank you man. That’s the solution. You saved me.

(I read https://ionic.zendesk.com/hc/en-us/articles/360037704753-Capacitor-Plugin-Development-Adding-iOS-podfile-dependencies but I didn’t realize that the podspec file is in the plugin folder.)