I am trying to add a custom Cordova plugin for the iOS platform, and I am having some problems when I compare this to the process of adding a plugin to a cord.
The plugin I'm trying to use here is https://github.com/phonegap-build/StatusBarPlugin
With cordova, I just used the command line c ordova plugin add com.phonegap.plugin.statusbar
Firstly, I tried changing in my own folder, but I noticed that if I do this, it will work, but it will be deleted the next time I deploy the iOS platform. Secondly, I tried to add files (plugin js file and cordova_plugins.js file.) In applications / myapp / iphone or apps / myapp / common, but this causes a problem. The file format cordova_plugins.jsdoes not seem completely understandable.
Instead of this working format:
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/org.apache.cordova.battery-status/www/battery.js",
"id": "org.apache.cordova.battery-status.battery",
"clobbers": [
"navigator.battery"
]
},
,
{
"file": "plugins/com.phonegap.plugin.statusbar/www/statusbar.js",
"id": "com.phonegap.plugin.statusbar.statusbar",
"clobbers": [
"window.StatusBar"
]
}
]
});
For this format, this format does not work properly:
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/org.apache.cordova.battery-status/www/battery.js",
"id": "org.apache.cordova.battery-status.battery",
"clobbers": [
"navigator.battery"
]
}
]
});
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/org.apache.cordova.battery-status/www/battery.js",
"id": "org.apache.cordova.battery-status.battery",
"clobbers": [
"navigator.battery"
]
},
{
"file": "plugins/com.phonegap.plugin.statusbar/www/statusbar.js",
"id": "com.phonegap.plugin.statusbar.statusbar",
"clobbers": [
"window.StatusBar"
]
}
]
});
How do i do Where should I put this file? How can I add this custom plugin, especially if I want to add it only for iOS, not for Android?