blob: d7f36600fd873eef064197bde19ef5ecbe6a529c [file] [log] [blame]
{
"name": "SOA-iOS-SDK",
"version": "0.1.1",
"summary": "SOA-iOS-SDK is a client built to consume SOA Server based APIs.",
"description": " [SOA Server](https://github.com/coderockr/soa) is a great way to build your Web Services, it's built on top of Silex and Doctrine 2, but using iOS as a client you couldn't get the same experience, until now. After a long time using SOA Server I decided to transport the same mindset to Objective-C and the result is this library.\n\n ##Getting SOA iOS SDK\n\n ###Cocoapods\n\n ##Configure it\n In order to get SOA SDK working, you must configure the API URL and shared headers.\n * apiURL for the REST Calls\n * rpcURL for the RPC Calls\n\n ```objc\n [SOAManager defaultManager].apiURL = [NSURL URLWithString:@\"http://serveraddress.com/api/v1\"];\n\n [SOAManager defaultManager].rpcURL = [NSURL URLWithString:@\"http://serveraddress.com/rpc/v1\"];\n\n [[SOAManager defaultManager] setDefaultHeaders:@{@\"Authorization\" : @\"_authorization_token_\"}];\n ```\n\n Including shared headers for each HTTP Method available at REST API.\n ```objc\n SOAServiceMethodGET,\n SOAServiceMethodPOST,\n SOAServiceMethodPUT,\n SOAServiceMethodDELETE,\n SOAServiceMethodALL\n\n [[SOAManager defaultManager] setDefaultHeaders:@{@\"Content-Type\" : @\"application/x-www-form-urlencoded\"} forMethod:SOAServiceMethodPOST];\n\n [[SOAManager defaultManager] setDefaultHeaders:@{@\"Content-Type\" : @\"application/x-www-form-urlencoded\"} forMethod:SOAServiceMethodPUT];\n ```\n\n ###Miscelaneous\n Right now, you can configure the queue concurrent requests limits and you can also delegate to SOA SDK the responsability to display or hide the Network Activity Status.\n ```objc\n [SOAManager defaultManager].maxConcurrentRequests = 4;\n [SOAManager defaultManager].controlNetworkActivity = YES;\n ```\n\n ##The SOA Object\n\n SOAObject is a NSObject subclass built to storage entity's data. SOAObject has only one mandatory property, which is Entity Name, but you can set the entity id. Both properties are intended to identify the object. \n\n Beyond it, you can store any kind of data (pointers) using setValue:forKey: and you can also retrieve any data using valueForKey: method.\n\n\n ###Creating New\n\n ```objc\n SOAObject *hotel = [[SOAObject alloc] initWithEntityName:@\"hotel\"];\n\n SOAObject *knownHotel = [[SOAObject alloc] initWithEntityName:@\"hotel\" entityId:12];\n ```\n ###Dealing with data\n ```objc\n [hotel setValue:@\"Ibis\" forKey:@\"name\"];\n [hotel setValue:@\"R. Nove de Março\" forKey:@\"street\"];\n\n NSString *name = [hotel valueForKey:@\"name\"];\n ```\n\n ###Fetching an Object\n ```objc\n [SOAObject getWithEntityName:@\"hotel\"\n entityId:12\n completionBlock:^(id result, NSError *error) {\n SOAObject *object = (SOAObject *)result;\n }];\n ```\n\n ###Saving an Object\n #####Static Way\n ```objc\n [SOAObject saveEntity:@\"hotel\"\n parameters:@{\n @\"id\" : @(10),\n @\"name\" : @\"Bourbon\",\n @\"street\" : @\"R. Visconde de Taunay\"\n }\n completionBlock:^(id result, NSError *error) {\n \n }];\n ```\n #####Instance Way\n ```objc\n [hotel saveWithCompletionBlock:^(id result, NSError *error) {\n \n }];\n ```\n ###Deleting an Object\n #####Static Way\n ```objc\n [SOAObject getWithEntityName:@\"hotel\"\n entityId:12\n completionBlock:^(id result, NSError *error) {\n SOAObject *object = (SOAObject *)result;\n }];\n ```\n #####Instance Way\n ```objc\n [hotel deleteWithCompletionBlock:^(id result, NSError *error) {\n \n }];\n ```\n ##The SOA Query\n ###Building a query\n ```objc\n SOAQuery *query = [[SOAQuery alloc] initWithEntityName:@\"hotel\"];\n query.offset = 0;\n query.limit = 100;\n query.fields = @[@\"name\", @\"id\"];\n ```\n\n ###SOA Filter\n ```objc\n SOAFilter *filter = [SOAFilter where:@\"id\" equalTo:@26];\n [query addFilter:filter];\n ```\n ###SOA Join\n ```objc\n SOAFilter *joinFilter = [SOAFilter where:@\"id\" equalTo:@10];\n SOAJoin *join = [SOAJoin joinField:@\"user\" withFilter:joinFilter];\n [query addJoin:join];\n ```\n\n ###Perform Query\n ```objc\n [query performQueryWithCompletionBlock:^(id result, NSError *error) {\n NSLog(@\"%@\", result);\n }];\n ```\n\n ##The SOA RPC Call\n\n ```objc\n SOARPCCall *rpc = [[SOARPCCall alloc] init];\n [rpc callProcedure:@\"/authentication/login\"\n parameters:@{@\"email\" : @\"user@email.com\", @\"password\" : @\"passwd\"}\n headers:nil\n completionBlock:^(id result, NSError *error) {\n NSLog(@\"%@\", result);\n NSLog(@\"%@\", error);\n }];\n ```\n",
"homepage": "https://github.com/espeiorin/SOA-iOS-SDK",
"license": {
"type": "MIT",
"file": "LICENSE"
},
"authors": {
"André Gustavo Espeiorin": "andre.espeiorin@gmail.com"
},
"social_media_url": "http://twitter.com/espeiorin",
"platforms": {
"ios": "7.0"
},
"source": {
"git": "https://github.com/espeiorin/SOA-iOS-SDK.git",
"tag": "0.1.1"
},
"source_files": [
"Classes",
"Classes/**/*.{h,m}"
],
"exclude_files": "Classes/Exclude",
"public_header_files": "Classes/**/*.h",
"frameworks": "UIKit",
"requires_arc": true,
"dependencies": {
"AFNetworking": [
"~> 2.0"
]
}
}