platform :ios, '13.0'

def capacitor_pods
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'Capacitor', :path => '../../../node_modules/@capacitor/ios'
  pod 'CapacitorCordova', :path => '../../../node_modules/@capacitor/ios'
end

target 'Plugin' do
  capacitor_pods
  pod 'FirebaseAuth', '11.0.0'
  pod 'GoogleSignIn', '7.1.0'
  pod 'FBSDKCoreKit', '17.1.0'
  pod 'FBSDKLoginKit', '17.1.0'
end

target 'PluginTests' do
  capacitor_pods
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # Source: https://stackoverflow.com/a/73839370/6731412
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      # Source: https://stackoverflow.com/a/58367269/6731412
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end
