Skip to content

Repository files navigation

###Drupal iOS SDK - Connect your iOS/OS X app to Drupal

built by Kyle Browning

####Introduction

The Drupal iOS SDK is a standard set of libraries for communicating to Drupal from any iOS device. Its extremely simple, and is basically a wrapper for AFNetworking. It combines the most used commands to communicate with Drupal and handles session managment for you(but it doesnt store passwords or persist CSRF/oAUTH tokens, you must do that(at least yet :))

####Installation

Create a pod file with (this will keep you on the 3.0 releases which is Drupal 8 specific)

 pod 'drupal-ios-sdk', '~> 3.0'

Then run

pod install

Requirements

DIOS VersionDrupal VersionMin iOS TargetNotes
3.xDrupal 8iOS 7.0
2.xDrupal 6-7iOS 5.0Requires Services module

####Configuration

In Drupal 8 things are a bit different, but much easier.

####First steps

 DIOSSession *sharedSession = [DIOSSession sharedSession];
[sharedSession setBaseURL:[NSURLURLWithString:@"http://d8"]];
[sharedSession setBasicAuthCredsWithUsername:@"admin"andPassword:@"pass"];

Currently 3.x only supports basic auth but will support oAuth soon

####Quick Examples

//create new userNSDictionary *user = @{@"name":@[@{@"value":@"username"}],@"mail":@[@{@"value":@"email@gmail.com"}],@"pass":@[@{@"value":@"passw0rd"}]};
[DIOSUser createUserWithParams:user success:nilfailure:nil];
//update existing nodeNSDictionary *node = @{@"uid":@[@{@"target_id":@"1"} ],@"body":@[@{@"value":@"Updated BOdy ",@"format":@"full_html"}],@"title":@[@{@"value":@"Updated Title"}]};
[DIOSNode patchNodeWithID:@"12"params:node type:@"page"success:nilfailure:nil];
//create new commentNSDictionary *parameters = @{@"subject":@[@{@"value":@"comment title"}],@"comment_body":@[@{@"value":@"a new body",@"format":@"basic_html"}]};
[DIOSComment createCommentWithParams:parameters relationID:@"7"type:@"comment"success:nilfailure:nil];
//get a user
[DIOSUser getUserWithID:@"1"success:nilfailure:nil];
//delete a node
[DIOSNode deleteNodeWithID:@"13"success:nilfailure:nil];

####Extras

Drupal iOS SDK Addons

####OAuth

Coming soon

####Troubleshooting

If you are getting Forbidden, you probably havnt setup your permissions.

####Questions

Checkout the Issue queue, or email me Email kylebrowning@me.com

About

The Drupal iOS Software Development Kit provides a full suite of iOS methods to natively connect iOS applications to Drupal 7 and 8.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors