HOME | DD
Published: 2014-02-05 18:50:28 +0000 UTC; Views: 23678; Favourites: 9; Downloads: 0
Redirect to original
Description
body div#devskin1262065 .gr-body { background:#FFFFFF; font:10pt/1.4em Verdana; border-bottom:1px solid #A6B2A6; } body div#devskin1262065 i.gb { display:none; } body div#devskin1262065 a { text-decoration:none; color:#2f779e; } body div#devskin1262065 a:hover { text-decoration:underline; } body div#devskin1262065 img { max-width:100%; } body div#devskin1262065 strong { font:bold 15px/normal Verdana, Geneva, sans-serif; color:#404040; margin:0 0 -10px; display:block; } body div#devskin1262065 p { max-width:800px; width:auto!important; width:800px; margin:0; } body div#devskin1262065 code { font:normal 11px/20px Monaco, 'Courier New', Courier, monospace; color:#1b3c59; background:#f2f6ff; border:1px solid #ccddff; display:block; padding:6px 0 20px 10px; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; margin:5px 0px 5px 0px; } body div#devskin1262065 div.positions { text-align:center; background:#0F3B6A; border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; padding:0 10px 1.3em 10px; margin:0 20px; } body div#devskin1262065 div.positions a { text-decoration:none; color:white; } body div#devskin1262065 div.positions a:hover { text-decoration:underline; }
We're happy to announce the release of version 1.0 of the Objective-C deviantART SDK . This SDK is a simple way to build great experiences using the deviantART API in your Mac or iOS apps.
Overview
The SDK requires iOS7 or OS X 10.9 and provides several classes for you to use and interact with:
- DVNTAPIClient - The core of the SDK. This class provides the OAuth2 management along with core network calls.
- DVNTAPIRequest - Provides simple wrapper methods around all API deviantART endpoints. If you find any that are missing, feel free to open a pull request to add them.
For the fastest integration, we recommend you use CocoaPods to install the SDK within your project, then simply import DVNTAPI.h with your codebase. DVNTAPI.h imports all the required headers for the SDK to function.
The Foundation
We have built the SDK upon the great foundation that is AFNetworking 2.0 , a widely used networking library in the iOS community, this means that the SDK will work on the latest versions of Apple's operating systems, iOS7 and OS X 10.9. We believe this is the best choice as it will allow us not to be held back by the code of the past and allow us to move forward as needed.
CocoaPods
To install the SDK within your project, use the below Podfile then run pod install:
platform :ios, '7.0'
pod "deviantART-SDK", "~> 1.0.0"
DVNTAPIClient
Atop AFNetworking, we built a layer of OAuth 2.0 abstractions to allow authentication and interaction with the deviantART API. With two method calls to DVNTAPIClient, you can be fully authenticated and ready to make calls to the API.
Simply set your client's ID and secret in the SDK in applicationDidFinishLoading:
[DVNTAPIClient setClientID:@"__CHANGE_ME__" clientSecret:@"__CHANGE_ME__"];
Then authenticate using your client details by calling:
[DVNTAPIClient authenticateFromController:self scope:@"basic" completionHandler:^(NSError *error) {
if(!error && [DVNTAPIClient isAuthenticated]) {
// App is fully authenticated with no errors
// and ready to perform API calls
} else {
NSLog(@"Error: %@", error);
}
}];
After authentication is completed, you can make calls to any API endpoint you need and the SDK will handle authentication for you.
DVNTAPIRequest
Using DVNTAPIClient as a base, DVNTAPIRequest builds upon its basic GET/POST methods to provide simple methods to call upon any endpoint on the deviantART SDK. Here's an example of retrieving a delta from the Sta.sh API.
[DVNTAPIRequest deltaWithCursor:@"12345" offset:120 success:^(NSURLSessionDataTask *task, id JSON) {
NSLog(@"JSON Response: %@", JSON);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Error: %@", error);
}];
DVNTAPIRequest covers all current API endpoints but if the need arises, you can use the GET/POST methods on DVNTAPIClient directly and authentication will still be handled completely by the SDK.
Documentation
For further documentation on getting started using the SDK, check the README file on GitHub. More in-depth Apple style documentation can be found here .
Open Source
The deviantART SDK is open source on GitHub and released under the BSD license . We will be accepting pull requests for changes from you, the community. Guidelines for issues, coding style and pull requests can be found in the project's README file.
We have also submitted the SDK to be available via CocoaPods, the biggest dependency manager for Objective-C projects. This will allow even simpler integration of the SDK into your current or new project.
Like the idea of working on stuff like this? Check out the open developer positions at deviantART.
Related content
Comments: 26
blueangel5383 [2014-05-02 23:28:21 +0000 UTC]
This is perfect timing. I was wondering how I could manage favorites and watching list etc through the API's it doesn't look like the API expose those functionalities. Please advise?
👍: 0 ⏩: 1
Pickley In reply to blueangel5383 [2014-05-22 23:03:32 +0000 UTC]
Currently we have no API endpoints for such functionality. If you wish to have such functionality, I suggest emailing developers@deviantart.com with your suggestions along with how you plan to use them .
👍: 0 ⏩: 0
ShadyLink In reply to Pickley [2014-02-18 22:04:00 +0000 UTC]
I was working on a dA app waaay back, totally cheating by logging into a webview... I am so ashamed. But now I don't have to!
👍: 0 ⏩: 1
Pickley In reply to ShadyLink [2014-02-18 23:08:18 +0000 UTC]
Cannot wait to see what you build using this. Keep me posted about it
👍: 0 ⏩: 1
deviant-garde [2014-02-12 02:33:37 +0000 UTC]
Despite not being a language I use myself (for the aforementioned reasons) I quite like the idea of what this is doing looking through the Cocoa Docs. I'm trying to imagine something like this in other languages.
👍: 0 ⏩: 1
Pickley In reply to deviant-garde [2014-02-12 17:57:33 +0000 UTC]
What would be some of the other languages you'd suggest?
👍: 0 ⏩: 1
deviant-garde In reply to Pickley [2014-02-12 22:16:46 +0000 UTC]
Ruby and Python would be perfect, and your Java (for Android SDK) idea makes perfect sense too.
👍: 0 ⏩: 1
DivinityArcane In reply to deviant-garde [2014-02-15 20:21:55 +0000 UTC]
Ruby is still actively used? did they finally fix how awfully inefficient the interpreter was?
👍: 0 ⏩: 1
deviant-garde In reply to DivinityArcane [2014-02-15 22:16:17 +0000 UTC]
Oh, they definitely kicked up the performance, both in 1.9 and 2.
👍: 0 ⏩: 1
DivinityArcane In reply to deviant-garde [2014-02-16 00:14:04 +0000 UTC]
I'll have to look into it at some point in the future. How viable is it compared to things like Python?
👍: 0 ⏩: 1
deviant-garde In reply to DivinityArcane [2014-02-16 02:56:08 +0000 UTC]
I think it's used in many of the same domains, but people are preferring Ruby over Python for new web-centric things.
👍: 0 ⏩: 1
DivinityArcane In reply to deviant-garde [2014-02-16 18:49:04 +0000 UTC]
..interesting. I know Rails caused a lot of sparks in the web dev arena, but I didn't think it'd become that widely used.
👍: 0 ⏩: 0
deviant-garde [2014-02-12 02:28:11 +0000 UTC]
Now all I clearly need to do is buy a Mac or a new iPhone
👍: 0 ⏩: 1
Pickley In reply to deviant-garde [2014-02-12 17:57:13 +0000 UTC]
Obviously you need both...
👍: 0 ⏩: 1