To run the example project, clone the repo, and run pod install
from the Example directory first.
To login to a Ghost blog use the KMMGhostLoginClient
, then create an instance of a class that conforms to KMMGhostLoginTokenParser
(e.g. KMMGhostLoginTokenJSONParser
) and an instance of a class that conforms to KMMGhostLoginSessionManager
(e.g. KMMGhostLoginJSONSessionManager
). Use these objects to create a login client:
KMMGhostLoginClient *client = [[KMMGhostLoginClient alloc] initWithManager:manager parser:parser];
[client loginWithUsername:@"username"
password:@"password"
complete:^(KMMGhostLoginToken *__nullable token, NSError *__nullable error) {
if(error) {
NSLog(@"An error occurred");
} else {
//Use token here to get your auth token
NSString *accessToken = token.accessToken;
}
}];
This project requires the latest iOS, iOS 8.4. It also has a dependency on AFNetworking version 2.6.
GhostLoginClient is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "KMMGhostLoginClient"
Alternatively, although I discourage this approach, clone the project and copy all the files under the Pod
folder into your project.
Kerr Marin Miller, @kerrmarin, www.kerrmarin.com
GhostLoginClient is available under the MIT license. See the LICENSE file for more info.