如何在 React Native 的 Podfile 中结合安装后安装?

Kev*_*Lee 5 ios cocoapods reactjs react-native react-native-ios

我需要将以下安装后添加到 Podfile。

post_install do |pi|
  pi.pods_project.targets.each do |t|
    t.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end
Run Code Online (Sandbox Code Playgroud)

但是遇到了这个错误。

[!] Invalid `Podfile` file: [!] Specifying multiple `post_install` hooks is unsupported..
Run Code Online (Sandbox Code Playgroud)

Podfile 中有两个安装后。我应该如何结合它们来解决错误?

post_install do |installer|
    flipper_post_install(installer)
  end
end

post_install do |pi|
  pi.pods_project.targets.each do |t|
    t.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end
Run Code Online (Sandbox Code Playgroud)

Oli*_*ier 5

以下似乎有效

  post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.targets.each do |t|
      t.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
  end
Run Code Online (Sandbox Code Playgroud)