-
Notifications
You must be signed in to change notification settings - Fork 16
Description
What we are trying to do
We are trying to use a dynamic framework (native iOS swift) for our extension. Specifically, use_frameworks! is being used.
What we have tried so far
For this, we have created a react-native bridge, which uses the same Framework.
This works perfectly in our react-native app when we add the following to our Podfile:
use_frameworks!
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
Pod::BuildType.static_library # I assume you use CocoaPods >= 1.9
end
end
end
end
We have published a version of our extension using the same, however the shoutem clone command fails at pod install with the following error when we clone this app from shoutem:
Again to fix this, we made the following changes to the Podfile:
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
Pod::BuildType.static_library
end
end
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
This resolves the pod install issue. However, this leads to Build fail with the following errors:
Another approach we have tried is use_modular_headers! instead of use_frameworks!. This eliminates the previous errors, however, the Build still fails with the following error:
Our entire Podfile is attached below:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false
target 'NewTest' do
config = use_native_modules!
use_react_native!
pod 'Shopify', :path => '../node_modules/shoutem.shopify/Shopify.podspec'
# React Native FBSDK dependencies
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
use_modular_headers!
$static_framework = ['CocoaLibEvent', 'openssl-ios-bitcode', 'OpenSSL-Universal']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
Pod::BuildType.static_library
end
end
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
pod 'RNNearBee', :path => '../node_modules/react-native-nearbee'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions-ble-fix'
pod 'Permission-BluetoothPeripheral', :path => "../node_modules/react-native-permissions/ios/BluetoothPeripheral.podspec"
pod 'Permission-LocationAlways', :path => "../node_modules/react-native-permissions/ios/LocationAlways.podspec"
pod 'Permission-LocationWhenInUse', :path => "../node_modules/react-native-permissions/ios/LocationWhenInUse.podspec"
pod 'Permission-Notifications', :path => "../node_modules/react-native-permissions/ios/Notifications.podspec"
end
## <Additional target>
use_flipper!
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
## <Extension postinstall targets>
if target.name == 'Starscream'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
Question
We can see that it is mentioned in your documentation that we are supposed to
Uncomment this line if you're using Swift or would like to use dynamic frameworks: https://shoutem.github.io/docs/extensions/tutorials/using-native-api#referencing-a-3rd-party-sdk
Is there a way to use iOS dynamic frameworks in our extension?


