How to install Cordova plugin cordova-plugin-icloudkv?


#1

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(() => {
    alert(JSON.stringify(cordova.plugins));
});

displays the following:

enter image description here

Problem

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

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

Question

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

Thanks

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.


#2

Solution:

declare var iCloudKV: any;


iCloudKV.load(

#3

Also says so in the docs of the plugin:

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