npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-icloudkv

v0.4.1

Published

Cordova iCloud Key Value Plugin

Downloads

5

Readme

phonegap-icloudkv-plugin

iOS iCloud KeyValue Store plugin for Cordova

Allows storing small amounts of configuration data in iCloud from Cordova/PhoneGap. Wraps NSUbiquitousKeyValueStore class.

Compatibility

Cordova/PhoneGap >= 3.0

Adding the plugin to your project

cordova plugin add cordova-plugin-icloudkv

Using the plugin

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

sync(successCallback/*(dictionary_with_all_sync_keys)*/ , failCallback)
   In addition to calling NSUbiquitousKeyValueStore sync method the plugin's sync returns the dictionary holding all iCloud data for the app.
   Normally you only need to call the sync once - on application load.
   Reminder: Calling sync does not guarantee (or matter for) syncrhonization with iCloud but only between the in-memory and the flash storage that will be eventually synced with iCloud by an independent agent.

save(key, value, successCallback)
   Saves string value for the key.

load(key, successCallback/*(value)*/, failCallback)
   Loads string value for the key.

remove(key, successCallback)
    Removes the key.

monitor(notificationCallback/*(value)*/, successCallback)
    Monitor changes of the app's iCloud.

For the simplest (but probably sufficient for most apps) implementation you will only need two methods: sync (on page load) and save (each time a value is changed).

Thanks

Special thanks to Pierrick Rouxel and Alexander Portnoy, for upgrading the plugin for Cordova 3.0.

Bugs and contributions

If you have a patch, fork my repo and send me a pull request. Submit bug reports on GitHub, please.

Changelog

v0.4.0:

  • Fixed monitor API.
  • Name changed to match new guidelines.

v0.3.0: First version of forked plugin:

  • Added proper wrapper code for including plugin into application using clobbers
  • Added plugin meta-data for cordova registry