A class to represent the server you want to connect to.
More...
#import <IndivoServer.h>
Inherits NSObject, and <IndivoLoginViewControllerDelegate>.
Inherited by IndivoMockServer.
A class to represent the server you want to connect to.
This is the main interaction point of the framework with your targeted Indivo Server.
- (void) authenticate: |
|
(INCancelErrorBlock) |
callback |
|
Strips current credentials and then does the OAuth dance again.
The authorize screen is automatically shown if necessary.
- Attention
- This call is only useful if a call is in progress (but has hit an invalid access token), so it will not do anything without a current call.
- Parameters
-
callback | An INCancelErrorBlock callback |
- (NSURL *) authorizeCallbackURL |
|
|
|
The callback to feed to authorizeURL.
Callback to let us know a call has finished.
The call will have called the callback by now, no need for us to do any further handling
- (MPOAuthAPI *) createOAuthWithAuthMethodClass: |
|
(NSString *) |
authClass |
error: |
|
(NSError *__autoreleasing *) |
error |
|
|
| |
Creates a new MPOAuthAPI instance with our current settings.
- Parameters
-
authClass | An MPOAuthAuthenticationMethod class name. If nil picks three-legged oauth. |
error | A pointer to an error object, which will be filled if the method returns null |
- (void) fetchAppSpecificDocumentsWithCallback: |
|
(INSuccessRetvalueBlock) |
callback |
|
Fetches global, app-specific documents.
GETs documents from /apps/{app id}/documents/ with a two-legged OAuth call.
Perform a method on our server This method is usally called by INServerObject subclasses, but you can use it bare if you wish.
- Parameters
-
- (BOOL) readyToConnect: |
|
(NSError **) |
error |
|
Obviously returns the record with the given id, returns nil if it is not found.
- (void) selectRecord: |
|
(INCancelErrorBlock) |
callback |
|
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.
- Parameters
-
callback | A block with a first BOOL argument, which will be YES if the user cancelled the action, and an error string argument, which will be nil if authentication was successful. By the time this callback is called, the "activeRecord" property will be set (if the call was successful). |
A convenience constructor creating the server for the given delegate.
Configuration is automatically read from "IndivoConfig.h"
- (BOOL) shouldAutomaticallyAuthenticateFrom: |
|
(NSURL *) |
authURL |
|
Callback when the call is stuck at user authorization.
- Returns
- We always return NO here, but display the login screen ourselves, loaded from the provided URL
Dequeues a call without finishing it.
This is useful for calls that need to be re-performed after another call has been made, e.g. if the token was rejected and we'll be retrying the call after obtaining a new token. In this case, we don't want the call to finish, but we can't leave it in the queue because it would block subsequent calls.
- Attention
- Do NOT use this to cancel a call because the callback will not be called!
The currently active record.
- (NSString *) activeRecordId |
|
readnonatomiccopy |
Shortcut method to get the id of the currently active record.
Shortcut to the active record id.
The id of the app as it is known on the server.
- (NSString *) callbackScheme |
|
readwritenonatomiccopy |
Defaults to "indivo-framework", but you can use your own.
- (NSString*) consumerKey |
|
readwritenonatomiccopy |
The consumer key for the app.
- (NSString*) consumerSecret |
|
readwritenonatomiccopy |
The consumer secret for the app.
A delegate to receive notifications.
- (NSMutableArray*) knownRecords |
|
readnonatomicstrong |
A cache of the known records on this server. Not currently used by the framework.
- (NSString*) lastOAuthVerifier |
|
readnonatomiccopy |
Storing our OAuth verifier here until MPOAuth asks for it.
- (BOOL) storeCredentials |
|
readwritenonatomicassign |
NO by default. If you set this to YES, a successful login will save credentials to the system keychain.
The UI-server URL (needed for login)
The documentation for this class was generated from the following files:
- IndivoFramework/Classes/IndivoServer.h
- IndivoFramework/Classes/IndivoServer.m