AlecGamble
AlecGamble

Reputation: 109

iOS Cordova first plugin - plugin.xml to inject a feature

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

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.

Thanks.

Upvotes: 2

Views: 139

Answers (1)

Gandhi
Gandhi

Reputation: 11935

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.

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

Upvotes: 1

Related Questions