How to install Cordova plugin cordova-plugin-icloudkv?

I am using Ionic and would like to install the following Cordova plugin.

I follow the instructions, and run:

cordova plugin add cordova-plugin-icloudkv

This adds the following entry to my config.xml:

<plugin name="cordova-plugin-icloudkv" spec="^0.4.1" />

So I deploy the code to the xcode iPhone emulator, and:

this.platform.ready().then(() => {

displays the following:

enter image description here


As you can see, the cordova-plugin-icloudkv is not there.

Also alert(cordova.plugins.iCloudKV); is undefined.


How do I install the Cordova plugin so I can access it with Ionic?


More info

My package.json contains the following.

        "cordova-plugin-inapppurchase": {},
        "cordova.plugins.diagnostic": {},
        "cordova-plugin-icloudkv": {}

As you can see diagnostic is there and is defined under cordova.plugins. Is the reason I cannot access icloudkv via cordova.plugins.icloudkv is because it is separated by -'s?

Ionic Native is accessing the cordova-plugin-inapppurchase.


declare var iCloudKV: any;


Also says so in the docs of the plugin:

The plugin becomes available when DeviceReady event is fired, it creates the object iCloudKV with …

1 Like