Deviant Login Shop  Join deviantART for FREE Take the Tour
Group Info Super Group Founded 12 Years ago Statistics 45 Members
338,667 Pageviews860 Watchers

Objective-C deviantART SDK

Mon Feb 10, 2014, 2:33 PM by Pickley:iconpickley:
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.


More Journal Entries

I prefer: 

27%
106 deviants said dont care
19%
72 deviants said july
15%
57 deviants said september
15%
56 deviants said june
13%
51 deviants said may
11%
44 deviants said august

Group Info

Super Group
Until Aug 13, 2014

Founded 12 Years ago
Oct 25, 2001

Location
Global

Group Focus
deviantART Related

45 Members
860 Watchers
338,667 Pageviews
Daily Pageviews

Sync

When DT finishes making a brand new deviantART feature, or just fixes a bug, we first run it on our top-secret staging server. When everything's ready to go live, we sync it!
  • yumeruby synced 1 hour, 2 minutes ago
  • muteor synced 8 hours, 58 minutes ago
  • micahgoulart synced 20 hours, 39 minutes ago
  • muteor synced 1 day, 1 hour ago
  • duraseb synced 1 day, 6 hours ago
  • yumeruby synced 1 day, 10 hours ago
  • DEVlANT synced 1 day, 23 hours ago
  • muteor synced 2 days, 7 hours ago
  • muteor synced 2 days, 8 hours ago
  • muteor synced 2 days, 8 hours ago
  • muteor synced 2 days, 8 hours ago
Syncs Per Day

Comments


Add a Comment:
 
:icondahub:
There's a bug in the watch list display that emerged within the past month.  I've tried filing a help desk ticket, but the response I received was dismissive and did not take this issue seriously, so I'll post the bug here in the hopes a developer will see it.

When clicking the "Next" button on the watch list, the 500th page is continuously displayed, regardless of which page you are on past 500.  With groups that approach 100,000 watchers, this prevents access to half of the watchers in the group.  Here are some example screen shots:
i.imgur.com/v6A0neT.png
i.imgur.com/X0ejOfA.png

There has been no announcement about a "500 page limit".  This feature has worked correctly for the past decade.  I really cannot fathom why this limit would suddenly be arbitrarily imposed, so this appears to be a mistake.  The "Next" button does not work as it should, so this is a bug with the site.

If someone could look into this, I would greatly appreciate it, thank you.
Reply
Flagged as Spam
:iconelectricjonny:
electricjonny Apr 1, 2014  Hobbyist Photographer
Hey guys, wondering why my script electricjonny.deviantart.com/a… is breaking now.

Not a bug report, just wondering why calls to the MessageCenter DiFi are now breaking.

Thanks :)

(I can, and will, investigate further, but any help on your side would be kind)
Reply
:iconyumeruby:
yumeruby Apr 2, 2014  Hobbyist General Artist
I just peeked at the history and the message center DiFi hasn't been touched in a while. Must have been some other change indirectly affecting it. Without knowing your script better the best I can suggest is comparing to actual MC queries on the site.
Reply
:iconelectricjonny:
electricjonny Apr 2, 2014  Hobbyist Photographer
Oh, forgive me.  It seems that my script now works.  Not sure why the "hickup", but all is functioning normally now.
Reply
:iconyumeruby:
yumeruby Apr 2, 2014  Hobbyist General Artist
Good to hear! :)
Reply
:iconelectricjonny:
electricjonny Apr 2, 2014  Hobbyist Photographer
Hmm, yeah I had seen this error in Firefox 30 (alpha), but had thought it was internal.  Seems there is "some other" problem here now.  I wonder what it is.  My guess is a change in the GM API.
Reply
:iconmistycascade:
MistyCascade Jan 31, 2014  Hobbyist General Artist
disregard my previous post. I just found the suggestion forum... 
Reply
:iconmistycascade:
MistyCascade Jan 31, 2014  Hobbyist General Artist
I don't know if this is where to give a suggestion, but I haven't found anywhere on dA yet where I can give suggestions. I am an Admin at All-World-Works , which is a very large group here on dA (almost 50,000 members). One of the things in our group that we do, is have a "submissions" folder where people dump all their artwork. Then a group of admins who are folder sorters (myself included), manually move everything to the folders they go in. Well, as you can imagine, that is rather tedious work.  I propose a feature for group administrators to be able to click on various pictures, and move it all to a different folder all at the same time. Similar to when submitting a picture to a group, people can click on several pictures to submit to a particular folder. This would make the job for group administrators way easier and more efficient. Thanks for your time! 
Reply
:iconlablayers:
LabLayers Jan 27, 2014  Student Interface Designer
Thought I'd drop this here in case anyone dreams in Node:


It passes back profile.username, profile.avatar to passport.js.
Reply
Add a Comment: