iOS Cordova第一个插件 - plugin.xml注入一个功能 [英] iOS Cordova first plugin - plugin.xml to inject a feature

查看:283
本文介绍了iOS Cordova第一个插件 - plugin.xml注入一个功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建我的第一个Cordova插件,我困惑于构建它的结构。我有一个新的Cordova项目,我已经添加了iOS平台。我正在寻找这个指导(特别是 Echo iOS插件示例部分):

I'm creating my first Cordova plugin and I'm confused to the structure of building it. I have a fresh Cordova project and I've added the iOS platform. I was looking at this for guidance (specifically the Echo iOS plugin example part):

https://cordova.apache.org/docs/en/5.1。 1 / guide / platforms / ios / plugin.html

但我对这个还挺新的,实际上应该是做的。它告诉我使用plugin.xml向本地平台的config.xml文件注入一个特性规范。是plugin.xml一个文件我需要创建或者是一个在 project>插件> cordova-plugin-whitelist> plugin.xml ?任何一种方式我如何使用它注入这个功能?我假设它是从它建立项目时读取的东西,但我仍然不确定如何做。

but I'm quite new to this and I'm a little bamboozled by what I'm actually supposed to be doing. It tells me to use plugin.xml to inject a feature specification to the local platform's config.xml file. Is the plugin.xml a file I need to create or is it the one in project> plugins> cordova-plugin-whitelist > plugin.xml? Either way how do I use it to inject this feature? I presume it's something it reads from when it builds the project but I'm still unsure how to do it.

谢谢。

推荐答案

至于我知道创建自定义插件,你必须根据规范创建一个插件文件夹,并确保插件在插件下的fetch.json文件夹。然后删除和重新添加平台应该照顾在各自的文件夹中的插件安装。

As far as i know to create custom plugins, you gotta create a plugin folder as per the specifications and ensure that the plugin is referred in the fetch.json file under plugins folder. Then removing and re-adding the platform should take care of plugin installation in respective folder. You can refer any of the existing plugins to replicate the same folder structure.

有关自定义插件创建的详细信息,请参阅 cordova官方文档。希望它有帮助

The detailed info on custom plugin creation is available in cordova official documentation.Hope it helps

这篇关于iOS Cordova第一个插件 - plugin.xml注入一个功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆