Richard
Richard

Reputation: 8935

Cordova Plugin how to install

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:

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.

Upvotes: 1

Views: 140

Answers (1)

Richard
Richard

Reputation: 8935

Solution:

declare var iCloudKV: any;


iCloudKV.load(

Upvotes: 1

Related Questions