FactualAPIDelegate


Protocol which defines FactualAPI callback methods

Extends Protocol: NSObject
Declared In: FactulAPI.h

Discussion

The Factual API is uses an asyncrhonous IO model, so all request completion/ failure notifications arrive via the delegate callback methods. You can implement this protocol in your main UIViewController or your AppDelegate implementation. All callbacks should arrive in the context of the main UI thread as long as the related API call was initiated in the UI Thread as well. Each method in the protocol takes a FactualAPIRequest object, which is used to establish context about the callback. You can either (retain) a reference to the Request object or the NSString request identifier property and use either attribute to associate requests with callback responses.



Methods

-requestDidReceiveInitialResponse:
-requestDidReceiveData:
-requestComplete:failedWithError:
-requestComplete:
-requestComplete:receivedUpdateResult:
-requestComplete:receivedQueryResult:
-requestComplete:receivedSchemaResult:

requestDidReceiveInitialResponse:


- (void)requestDidReceiveInitialResponse:(FactualAPIRequest *)request; 
Parameters
request

The request context object

Discussion

This method gets called when an initial server response is received for a Factual API call


requestDidReceiveData:


- (void)requestDidReceiveData:(FactualAPIRequest *)request; 
Parameters
request

The request context object

Discussion

This method gets called every some data is received from the server with respect to a Factual API call


requestComplete:failedWithError:


- (void)requestComplete:(FactualAPIRequest *)request 
        failedWithError:(NSError *)error; 
Parameters
request

The request context object

error

The NSError description of the error

Discussion

This method gets called when a API request fails due to either local network issues or server related issues. A description of the error is returned in the NSError object. No more callbacks will be initiated for the Request object in question


requestComplete:


- (void)requestComplete:(FactualAPIRequest*) request; 
Parameters
request

The request context object

Discussion

This method gets called when a request with no return value successfully completes on the server. (flagBadRow).


requestComplete:receivedUpdateResult:


- (void)requestComplete:(FactualAPIRequest*) request 
        receivedUpdateResult:(FactualUpdateResult*) updateResult; 
Parameters
request

The request context object

updateResult

The FactualUpdateResult result object

Discussion

This method gets called when a submitDataRequest request successfully completes on the server. The results of the request are passed to the caller in the FactualUpdateResult object. Please see related FactualUpdateResult docs for more details.


requestComplete:receivedQueryResult:


- (void)requestComplete:(FactualAPIRequest*) request 
        receivedQueryResult:(FactualQueryResult*) queryResult; 
Parameters
request

The request context object

queryResult

The FactualQueryResult result object

Discussion

This method gets called when a queryTable request successfully completes on the server. The results of the request are passed to the caller in the FactualQueryResult object. Please see related FactualQueryResult docs for more details.


requestComplete:receivedSchemaResult:


- (void)requestComplete:(FactualAPIRequest*) request 
        receivedSchemaResult:(FactualSchemaResult*) schemaResult; 
Parameters
request

The request context object

schemaResult

The FactualSchemaResult result object

Discussion

This method gets called when a getTableSchema request successfully completes on the server. The results of the request are passed to the caller in the FactualSchemaResult object. Please see related FactualSchemaResult docs for more details.

Last Updated: Friday, January 28, 2011