- LHTMDbClient is an iOS wrapper on top of AFNetworking to interact with themoviedb.org API.
- This project is forked from Javi Lorbada - JLTMDbClient
- The best way to get LHTMDbClient is by using CocoaPods.
(currently only via pod and the point to git availible because: "[!] Push access is currently disabled while we allow for owners to claim their Pods.")
pod 'LHTMDbClient, git: => https://github.com/HerbstLukas/LHTMDbClient.git'
-
Or you just clone this repository and add the LHTMDbClient folder to your project.
Not done yet. Will follow.
- Get your API KEY from themoviedb.org
"A TMDb user account is required to request an API key. Commercial users are approved on a per application basis. As always, you must attribute TMDb as the source of your data. Please be sure to read the API FAQ"
- Add LHTMDbClient to your application, and set up your API KEY in the AppDelegate - didFinishLaunchingWithOptions.
#import <LHTMDbClient.h>
[[LHTMDbClient sharedAPIInstance] setAPIKey:@"API_KEY"];
- Call a service to get the response from the server *, i.e:
[[LHTMDbClient sharedAPIInstance] GET:kLHTMDbMoviePopular withParameters:nil andResponseBlock:^(id response, NSError *error) {
if(!error){
fetchedData = response;
NSLog(@"Popular Movies: %@",fetchedData);
}
}];
- When you want to get a specifik episode of an season you can do it like this:
[[LHTMDbClient sharedAPIInstance] GET:kLHTMDbTV withParameters:@{@"id":self.showId ,@"season_number":self.seasonNr, @"episode_number":self.episodeNr} andResponseBlock:^(id response, NSError *error)
{
if (!error)
{
self.tvShwoData = response;
NSLog(@"%@", self.tvShwoData);
} else
{
NSLog(@"%@", error);
}
}];
Options have to be NSStrings - and you have to use the IDs @"id", @"season_number" and @"episode_number".
See the Table of contents which request require which options.
If there are any questions please contact me.
- Compatible with iOS 7.0.
- Does require ARC.
- AFNetworking 2.0.0 or superior.
- LHTMDbClient is released under a MIT-License. See License file for more info.
- Thanks to Javi Lorbada and his project JLTMDbClient
- Thanks to themoviedb.org for the awesome API <3.
- Lukas Herbst
- Follow @HerbstLukas on twitter
- http://lks.is