TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
Arkio is an Objective-C client library for Data.com.
1. Features | 5. Configuration |
2. API Overview | 6. Coding Quick Start |
3. Requirements | 7. Unit Tests |
4. Installation | 8. Reference Documentation |
Full implementation of the Data.com Connect API means that you are able to do the following with Arkio:
Arkio is written for ARC-enabled apps. By default your build target will need to comply with one of the following:
If you aren't using ARC, you can still use Arkio by specifying the -fobjc-arc
compiler flag for the implementation files (*.m) in your target's Compile Sources section of the Build Phases tab.
Arkio depends on CocoaPods in order to build successfully. Installation via CocoaPods is the only recommended way of integrating Arkio with your project. Why? Arkio depends on AFNetworking, and that is most easily available via CocoaPods.
Simply add the following line to your project's Podfile:
pod 'Arkio'
then, at the command line, from the same directory as your Podfile, run
pod install
Bear in mind that you will not get the unit test suite or the ability to install the AppleDoc docset locally if simply integrating Arkio with your project as explained above.
If you would like to install the included AppleDocs docset locally so the docset appears in the Xcode Documentation Viewer, or view and run the XCTest unit test suite you will need to clone the repo from GitHub to your local machine. You will need to run the CocoaPods command pod install
in the root directory of the repo before building the "Install AppleDocs" target for the project. By default, the docset is installed to the "~/Library/Developer/Shared/Documentation/DocSets" location with the package name of "com.alienhitcher.Arkio.docset".
To interface successfully with the Data.com API you will need a Developer Token/Key. The easiet way to configure Arkio is to add your developer token to you app's Info.plist file as the value for the key "arkio.api.developer.token", as below:
This allows ARKSession
instances to pick up the value automatically. Alternately, you can set the token value directly on the session as below:
[arkSession setAPIDeveloperToken:@"developertokentext"];
After installation and configuration, import the library header file somewhere sensible in your code:
#import "Arkio.h"
Then, initialize an ARKSession
with a valid Data.com username and password, and use the methods on the session to interface with the API.
ARKSession *session = [[ARKSession alloc] initWithUsername:@"[email protected]"
password:@"foobar"];
[session userInformation:^(long points, ARKError *error) {
if (!error) {
NSLog(@"points = %ld ", points);
}
else {
// we receive an application error message from Data.com
NSLog(@"ark error: %@", error);
}
}
failure:^(NSError *error) {
// an unexpected HTTP network error occurred
NSLog(@"failed with network error: %@", error);
}
];
Cloning the repo from GitHub will give you access to the XCTest unit tests. They live in the ArkioTests folder, and are a good place to find working examples of using Arkio.
The tests require 3 configuration settings before they'll run against a Data.com API endpoint. Navigate to the "ArkioTests/Supporting Files" folder and add values for the following keys in the ArkioTests-Info.plist file:
Parameters for the API calls made in the unit tests are stored in the supporting file named ArkioTestData.plist.
You will need to run the CocoaPods command pod install
in the root directory of the repo before building for testing with ⇧⌘U.
Arkio is maintained by Ray Scott (@rayascott).
Arkio is available under the MIT license. For more information, see the included LICENSE file.