使用 CLI 命令或 Ionic 配置将 AdSupport Framework 添加到 Xcode 项目

Add AdSupport Framework to an Xcode project with CLI command or Ionic configuration

我目前正在开发目标平台为 ios 的离子应用程序。我使用 Firiebase Analytics 插件和 this requires to add AdSupport Framework 进入 Xcode 构建配置。

我不想手动添加它,因为它记录在案,因为它会破坏我的连续交付过程。有没有办法通过 CLI 或离子配置以编程方式将框架添加到构建中?

尝试:

打开 plugin.xml(在 firebase analytics 插件文件夹中)并在 ios 下面一行:

<platform name="ios">
   <framework src="pointToYour/File.framework" embed="true" />
</platform>

根据文档(1)(2)无法在项目 config.xml 中指定。但是,您可以在编写新插件时在 Plugin.xml 中指定 ios 需要哪个框架库。

这是 framework 属性 :

Identifies a framework (usually part of the OS/platform) on which the plugin depends.

// In Plugin.xml
<framework src="libsqlite3.dylib" />
<framework src="social.framework" weak="true" />
<framework src="relative/path/to/my.framework" custom="true" />
<framework src="GoogleCloudMessaging" type="podspec" spec="~> 1.2.0" />

我找到了一个插件,可以 here and I forked it 满足我的特殊需求。