
(C) i3Software 2012
By: a guest on
Feb 7th, 2012 | syntax:
Objective C | size: 0.73 KB | hits: 77 | expires: Never
-(void)testFacepunchAPI {
FPAPI *apiInstance = [FPAPI sharedInstance];
[apiInstance authenticateWithUsername:@"i300" password:@"colbert2012" andCallbackDelegate:self];
}
// Called when Authentication is completed
-(void)facepunchAPIAuthenticationComletedWithPayload:(NSDictionary *)payload {
FPAPI *apiInstance = [FPAPI sharedInstance];`
[apiInstance getForumsWithCurrentSessionAndCallbackDelegate:self];
}
// Called when GetForums is completed
-(void)facepunchGetForumsCompletedWithForums:(NSArray *)forums {
FPCategory *firstCategory = [forums objectAtIndex:0];
NSLog(@"The first category returned by the API is: %@", firstCategory.name);
// Outputs
// The first category returned by the API is: General Discussion
}