Code Monkey home page Code Monkey logo

appcelerator-modules.ti.icloud's Introduction

Ti.iCloud Module

Description

Gives you access to storing simple key-value pairs in iCloud. Values will be synchronized across all of the user's iOS devices.

Requirements

There are several requirements for this module to function properly:

  1. This module will ONLY work with iOS 5 devices and higher. THE SIMULATOR WILL NOT WORK!
  2. All provisioning profiles must have been generated from an application configured to support iCloud. Check in your Provisioning Portal > App IDs that the "iCloud" column says "Enabled" beside your app.
  3. The device must be set up to use iCloud, and be signed in to an iCloud account.

Otherwise, you will receive warnings, and any calls to the "sync" method will return false.

If you have met the above requirements and you are still receiving errors, try removing the profiles from your device, and delete them from your Apple account. Regenerate them and try again.

Getting Started

View the Using Titanium Modules document for instructions on getting started with using this module in your application.

Accessing the Ti.iCloud Module

To access this module from JavaScript, you would do the following:

var iCloud = require('ti.icloud');

Methods

bool sync()

Forces your recent property changes to be saved to disk. Calling this method is optional, and it does not influence when Apple chooses to synchronize your changes with their servers and other iOS devices.

void setString(string key, string value)

Stores a string.

void setBool(string key, bool value)

Stores a boolean.

void setDictionary(string key, dictionary value)

Stores a dictionary of any serializable values.

void setList(string key, object[] value)

Stores an array of serializable values.

void setInt(string key, int value)

Stores an integer.

void setDouble(string key, double value)

Stores a double.

void setObject(string key, object value)

Stores a serializable object.

string getString(string key)

Retrieves a previously stored string.

bool getBool(string key)

Retrieves a previously stored boolean.

dictionary getDictionary(string key)

Retrieves a previously stored dictionary.

object[] getList(string key)

Retrieves a previously stored array.

int getInt(string key)

Retrieves a previously stored integer.

double getDouble(string key)

Retrieves a previously stored double.

object getObject(string key)

Retrieves a previously stored object.

dictionary getAll()

Retrieves all previously stored properties as a dictionary. The key you stored the property with will be its key in the dictionary.

void remove(string key)

Removes a previously stored property permanently.

Events

externalChange

The value changed on the remote server. This can occur when another device syncs a new value to the server.

Receives a dictionary with the following keys:

  • keys ([String]): Affected store keys.

needsInitialSync

Local changes were discarded because an initial sync from the server has not yet happened. Initial syncs happen the first time the device is synced but may also happen when user account settings change.

Receives a dictionary with the following keys:

  • keys ([String]): Affected store keys.

quotaViolated

The key-value store has exceeded its space quota on the server.

Receives a dictionary with the following keys:

  • keys ([String]): Affected store keys.

accountChange

The user has changed the primary iCloud account. The keys and values in the local key-value store have been replaced with those from the new account, regardless of the relative timestamps.

Receives a dictionary with the following keys:

  • keys ([String]): Affected store keys.

Usage

See example/app.js.

Author

Matthew Apperson, Hans Knöchel

Module History

View the change log for this module.

Feedback and Support

Please direct all questions, feedback, and concerns to [email protected].

License

Copyright(c) 2010-Present by Axway Appcelerator. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.

appcelerator-modules.ti.icloud's People

Contributors

hansemannn avatar jeffenglish avatar muhammaddadu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.