Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
|
Mock Server to replace IndivoServer for unit testing. More...
#import <IndivoMockServer.h>
Inherits IndivoServer.
Instance Methods | |
(NSString *) | - readFixture: |
![]() | |
(void) | - authenticate: |
Strips current credentials and then does the OAuth dance again. More... | |
(NSURL *) | - authorizeCallbackURL |
The callback to feed to authorizeURL. More... | |
(void) | - callDidFinish: |
Callback to let us know a call has finished. More... | |
(MPOAuthAPI *) | - createOAuthWithAuthMethodClass:error: |
Creates a new MPOAuthAPI instance with our current settings. More... | |
(void) | - fetchAppSpecificDocumentsWithCallback: |
Fetches global, app-specific documents. More... | |
(void) | - performCall: |
Perform a method on our server This method is usally called by INServerObject subclasses, but you can use it bare if you wish. More... | |
(BOOL) | - readyToConnect: |
(IndivoRecord *) | - recordWithId: |
Obviously returns the record with the given id, returns nil if it is not found. More... | |
(void) | - selectRecord: |
This is the main authentication entry point, this method will ask the delegate where to present a login view controller, if authentication is necessary, and handle all user interactions until login was successful or the user cancels the login operation. More... | |
(BOOL) | - shouldAutomaticallyAuthenticateFrom: |
Callback when the call is stuck at user authorization. More... | |
(void) | - suspendCall: |
Dequeues a call without finishing it. More... | |
![]() | |
(NSString *) | - callbackSchemeForLoginView: |
Before loading a URL that URL is checked whether the scheme corresponds to the internal scheme, and if it does a different action may be performed than loading the URL in the webView. More... | |
(void) | - loginView:didReceiveVerifier: |
Called when the login screen gets called with our verifier callback URL. More... | |
(void) | - loginView:didSelectRecordId: |
Called when a record was selected. More... | |
(void) | - loginViewDidCancel: |
The user dismissed the login screen without loggin in successfully. More... | |
(void) | - loginViewDidLogout: |
If the user logged out, we want to discard cached data. More... | |
Properties | |
NSDictionary * | mockMappings |
Two dimensional, first level is the method (GET, POST, ...), second a mapping path -> fixture.xml. More... | |
IndivoRecord * | mockRecord |
![]() | |
IndivoRecord * | activeRecord |
The currently active record. More... | |
NSString * | activeRecordId |
Shortcut method to get the id of the currently active record. More... | |
NSString * | appId |
The id of the app as it is known on the server. More... | |
NSString * | callbackScheme |
Defaults to "indivo-framework", but you can use your own. More... | |
NSString * | consumerKey |
The consumer key for the app. More... | |
NSString * | consumerSecret |
The consumer secret for the app. More... | |
id< IndivoServerDelegate > | delegate |
A delegate to receive notifications. More... | |
NSMutableArray * | knownRecords |
A cache of the known records on this server. Not currently used by the framework. More... | |
NSString * | lastOAuthVerifier |
Storing our OAuth verifier here until MPOAuth asks for it. More... | |
BOOL | storeCredentials |
NO by default. If you set this to YES, a successful login will save credentials to the system keychain. More... | |
NSURL * | ui_url |
The UI-server URL (needed for login) More... | |
NSURL * | url |
The server URL. More... | |
Additional Inherited Members | |
![]() | |
(id) | + serverWithDelegate: |
A convenience constructor creating the server for the given delegate. More... | |
Mock Server to replace IndivoServer for unit testing.
When performing a call it parses the request URL and immediately calls the "didFinishSuccessfully:returnObject:" method, supplying data of the respective call if the request URL was understood by the mock server.
- (NSString *) readFixture: | (NSString *) | fileName |
|
readwritenonatomiccopy |
Two dimensional, first level is the method (GET, POST, ...), second a mapping path -> fixture.xml.
|
readwritenonatomicstrong |