Code Monkey home page Code Monkey logo

syncano-ios's Introduction

Syncano iOS Library

Overview


Syncano's iOS library is written in Objective-C and provides communication with Syncano (www.syncano.com) via HTTPS RESTful interface and TCP sockets.

The full source code can be found on Github - feel free to browse or contribute.

Click here to learn more about Syncano or create an account!

Build Library


We use CocoaPods for external libraries dependencies and their installation. You have to install CocoaPods plugin and use it to install external libraries Syncano's iOS Library depends on.

To install CocoaPods on your Mac type:

$ [sudo] gem install cocoapods

To install libraries used by syncano-ios execute this command in the same directory as the 'Podfile' file:

$ pod install

To compile the library, make sure to use syncano-ios.xcworkspace (not .xcodeproj).

Downloading


You can download archived sources of the latest version of Syncano’s iOS Library by right clicking on following link and choosing “Save As…”:

syncano-ios archive on GitHub

Our library depends on following third party frameworks, so you will need to download them as well:

CocoaAsyncSocket

AFNetworking

Mantle

If you want to use CocoaPods, add this to your Podfile:

pod ‘syncano-ios’, ‘~>3.1.2’

Installing


Unzip previously downloaded files, drag the .xcodeproject files to your project/workspace, and add their targets as your app dependency.

If you use CocoaPods, after adding our library to your Podfile, type the following into your terminal:

$ pod install

Modification


To add external library dependencies, edit 'Podfile' in your main directory and type:

pod 'library name' 

To remove an external library, remove the line with this library in 'Podfile', save it, and execute this command:

$ pod install

Documentation and further information on CocoaPods is available at: http://cocoapods.org/

Documentation


Appledoc documentation can be generated by building a Documentation target in syncano-ios.xcworkspace. Docs will be in the Syncano-Docs directory and will be installed to the Xcode documentation, too. In case something is wrong, logs are put into the appledoc.log file. If you need to download appledoc visit https://github.com/tomaz/appledoc/.

To write documentation, we recommend using the VVDocumenter XCode plugin. It makes writing correctly structured documentation a little easier. Simply place your cursor above method/class/anything you wish to describe, and type /// to generate a documentation template snippet for that item.

Getting started


Import Syncano header

/// Used for REST connection
#import <Syncano/Syncano.h>

Create main Syncano object

(This will be used to send requests to your instance of Syncano.):

Syncano *syncano = [Syncano syncanoForDomain:@“YOUR-SYNCANO-DOMAIN” apiKey:@“YOUR-API-KEY-123456”];

Send data to Syncano

(Use a project ID and collection ID from your admin GUI, i.e. YourDomain.syncano.com, for the below. You can use the “default” values or create your own.):

NSString *textToSend = @“Some sample text”;
UIImage *imageToSend = [UIImage imageNamed:@“sampleImage.png”];

SyncanoParameters_DataObjects_New *params = [[SyncanoParameters_DataObjects_New alloc] initWithProjectId:@“PROJECT_ID” collectionId:@“COLLECTION_ID” state:@"pending"];
params.text = textToSend;
params.image = imageToSend;

///For an asynchronous connection, enter the below and work with the returned response
[syncano dataNew:params callback:^(SyncanoResponse_DataObjects_New *response) {
	if (response.isResponseOK) {
	}
}

Download data from Syncano:

///Describe what you want to download by using parameters
SyncanoParameters_DataObjects_Get *params = [[SyncanoParameters_DataObjects_Get alloc] initWithProjectId:@“PROJECT_ID” collectionId:@“COLLECTION_ID”];
params.dataId = @“123456”; // set if you want to download one particular object. Leave empty if you want to download all objects from that collection

///For an asynchronous connection, enter the below and work with the returned response
	[syncano dataGet:params callback:^(SyncanoResponse_DataObjects_Get *response) {
	if (response.isResponseOK) {
		SyncanoData *data = response.data;
	}
}

We also offer synchronous connections if you’d like to manage threading yourself. You can use the exact same methods to connect with Syncano using TCP socket - just use SyncanoSyncServer class object instead of Syncano class.

License


Syncano's iOS Library (syncano-ios) is available under the MIT license. See the LICENSE file for more info.

syncano-ios's People

Contributors

mariuszwisniewski avatar 3-n avatar

Watchers

James Cloos 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.