ios – Link binary with library from podspec

0
60


I am developing a React-Native library that contains native modules. This library depends on react-native-webrtc and also has a native dependency on the WebRTC.xcframework that is shipped with react-native-webrtc as a vendored_framework. Now to make this work I need to link my library with WebRTC.xcframework. However this has to happen in the podspec of my library as users of my library should not link my shipped pod manually with the WebRTC framework, so using the “Link Binary with Libraries” build phase is not an option. As the framework is not being published with my library, using the vendored_framework spec also doesn’t work.

My podspec so far tries this:

 s.preserve_paths="{PODS_ROOT}/../../node_modules/react-native-webrtc/apple/**/*"
  
  s.pod_target_xcconfig = { 
    "FRAMEWORK_SEARCH_PATHS" =>  '"${PODS_ROOT}/../../node_modules/react-native-webrtc/apple"',
    "HEADER_SEARCH_PATHS" => '"{PODS_ROOT}/../../node_modules/react-native-webrtc/apple"',
    "OTHER_LDFLAGS" => '-framework WebRTC'
  }

However, the #import <WebRTC/WebRTC.h> in my code still doesn’t work.
Thankful for any help!