TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2016 |
Maintained by Piet Brauer, Matthias Männich, Renzo Crisóstomo, Martin Kim Dung-Pham.
The initial release of the Pod was named XINGAPI
. This was confusing a lot of our users so we decided to rename it after the repository XNGAPIClient
.
PLEASE NOTE that in favor of the new XNGAPIClient
the XINGAPI
pod will no longer be updated. Please switch your codebase to be future-proof.
If you have any questions please open an issue.
XNGAPIClient is the official client to access the XING API. In order to access the API, you only need an account on https://xing.com and an oauth consumer key and secret which can be obtained at https://dev.xing.com. Both is totally free and only takes a minute!
XNGAPIClient is built on top of AFNetworking, so it takes full advantage of blocks. We also included an example project that takes care of storing your oauth token in the keychain to get you started even quicker. At the moment only iOS is supported. Not tested yet on Mac OS X.
If you use CocoaPods, you can add the XNGAPIClient
pod to your Podfile. Then run pod install
, and the XING API Client will be available in your project.
Clone & Watch our repository by visiting https://github.com/xing/XNGAPIClient
You can obtain a consumer key and consumer secret by visiting https://dev.xing.com/applications and pressing the create app button.
You need to setup the callback URL, which can be called after the user successfully logged in via Safari. Using the XING API Client your callback URL scheme will be xingapp<YOUR CONSUMER KEY>
. An example would be xingapp4a568854ef676b
To set it up just these steps:
#import XNGAPI.h
in your Application Delegate- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
if ([[XNGAPIClient sharedClient] handleOpenURL:url]) {
return YES;
} else {
//insert your own handling
}
return NO;
}
register your consumer key and secret with the shared client:
XNGAPIClient *client = [XNGAPIClient sharedClient];
client.consumerKey = @"xXxXxXxXxXxXxXxXxXxXxX";
client.consumerSecret = @"xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxX";
login with oauth:
[client loginOAuthWithSuccess:^{
// handle success
}
failure:^(NSError *error) {
// handle failure
}];
make a call to load your own profile:
[client getUserWithID:@"me"
userFields:nil
success:^(id JSON) {
// handle success
}
failure:^(NSError *error) {
// handle failure
}];
XING AG
XNGAPIClient is available under the MIT license. See the LICENSE file for more info.