AeroGear developer release

Yesterday we released a new version of the AeroGear library! Highlights are a more fluent API to create pipes,stores and authModules. Another milestone was the usage of using the previously discussed configuration objects!

Get it from the CocoaPods repo!

New way to create a AGPipe:

// NSURL object:
NSURL* serverURL = [NSURL URLWithString:@"http://todo-aerogear.rhcloud.com/todo-server/"];

// create the 'todo' pipeline, which points to the baseURL of the REST application
AGPipeline* todo = [AGPipeline pipeline:serverURL];

// Add a REST pipe for the 'projects' endpoint
id<AGPipe> projects = [pipeline pipe:^(id<AGPipeConfig> config) {
    [config name:@"projects"];
    [config type:@"REST"];
}];

New way to create a AGStore:

// create the datamanager
AGDataManager* dm = [AGDataManager manager];
// add a new (default) store object:
id<AGStore> myStore = [dm store:^(id<AGStoreConfig> config) {
    [config name:@"tasks"];
    [config TYPE:@"MEMORY"];
}];

New way to create a AGAuthenticationModule:

// create an authenticator object
AGAuthenticator* authenticator = [AGAuthenticator authenticator];

// add a new auth module and the required 'base url':
NSURL* baseURL = [NSURL URLWithString:@"https://todoauth-aerogear.rhcloud.com/todo-server/"];
id<AGAuthenticationModule> myMod = [authenticator auth:^(id<AGAuthConfig> config) {
    [config name:@"authMod"];
    [config baseURL:baseURL];
}];

As always, feedback and JIRAs are welcome!

About these ads

Howdy!

Posted in aerogear

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 33 other followers

%d bloggers like this: