Accela SDK for iOS  V3.0
AccelaMobile Class Reference

#import <AccelaMobile.h>

Inheritance diagram for AccelaMobile:
<AMRequestDelegate>

List of all members.

Public Member Functions

(id) - initWithAppId:withAppSecret:
(id) - initWithAppId:withAppSecret:withAuthHost:withApiHost:
(id) - initWithAppId:withAppSecret:andDelegate:
(id) - initWithAppId:withAppSecret:andDelegate:withAuthHost:withApiHost:
(void) - authorize:
(void) - authorize:withAgency:
(BOOL) - handleOpenURL:sourceApplication:annotation:
(void) - handleDidBecomeActive
(void) - authenticate:user:password:loginDialogDelegate:
(void) - authorizeAgencyApp:
(void) - authorize2:
(void) - authorize2:withAgency:
(BOOL) - isSessionValid
(void) - logout
(id) - fetchWithPath:urlParams:error:
(id) - fetchWithPath:urlParams:httpMethod:data:error:
(AMRequest *) - requestWithPath:urlParams:requestDelegate:
(AMRequest *) - requestWithPath:urlParams:httpMethod:data:requestDelegate:
(AMRequest *) - requestWithPath:urlParams:httpMethod:data:attachments:requestDelegate:
(AMRequest *) - uploadAttachment:urlParams:attachment:requestDelegate:
(AMRequest *) - downloadAttachment:urlParams:localPath:requestDelegate:

Static Public Member Functions

(AccelaMobile *) + defaultInstance

Protected Attributes

NSString * _appId
NSDictionary * _userProfile

Properties

id< AMSessionDelegate_sessionDelegate
id< AMSessionDelegatesessionDelegate
NSString * amClientId
NSString * amClientSecret
NSString * amAuthHost
NSString * amApiHost
NSDictionary * userProfile
NSDictionary * httpHeaders
ENVIRONMENT_TYPE amEnvironmentType
BOOL amIsRemember

Detailed Description

AccelaMobile is the main object of the Accela SDK for iOS.


Member Function Documentation

- (void) authenticate: (NSString *)  agency
user: (NSString *)  user
password: (NSString *)  password
loginDialogDelegate: (2_0) 
(5_0)  NS_DEPRECATED_IOS 

Authenticates that the agency name, user name and password are valid for Agency App.

Parameters:
agencyThe agency name of the Accela Automation.
userThe name of the user to be validated.
passwordThe password for the specified user.
loginDialogDelegateAMLoginDialogDelegate for information on the delegate protocol.
Returns:
The AMRequest object corresponding to this API call.
Deprecated:
Since:
1.0
- (void) authorize2: (NSArray *)  permissions

Authorizes the user of the application with default agency definded in cloud, the login form was wrapped as a native dialog

The Login Dialog will be presented for the user to use to login if does not exit the valid token.

If the user has authenticated and still has a valid session the the user will be authorized without seeing the Login Dialog.

The schema of this app MUST be defined, and handleOpenURL MUST be invoked in the delegate of this app. refer to the method handleOpenURL of AccelaMobile.

Parameters:
permissionsresources list to be accessed. refer to the Scope in https://developer.accela.com/docsv3/ApisAbout
Since:
3.0
- (void) authorize2: (NSArray *)  permissions
withAgency: (NSString *)  agency 

Authorizes the user of the application, the login form was wrapped as a native dialog

The Login Dialog will be presented for the user to use to login if does not exit the valid token.

If the user has authenticated and still has a valid session the the user will be authorized without seeing the Login Dialog.

The schema of this app MUST be defined, and handleOpenURL MUST be invoked in the delegate of this app. refer to the method handleOpenURL of AccelaMobile.

Parameters:
permissionsresources list to be accessed. refer to the Scope in https://developer.accela.com/docsv3/ApisAbout
agencydefault agency name for the citizen App
Since:
3.0
- (void) authorize: (NSArray *)  permissions

Authorizes the user of the application with default agency definded in cloud

The Login Dialog will be presented for the user to use to login if does not exit the valid token.

If the user has authenticated and still has a valid session the the user will be authorized without seeing the Login Dialog.

The schema of this app MUST be defined, and handleOpenURL MUST be invoked in the delegate of this app. refer to the method handleOpenURL of AccelaMobile.

Parameters:
permissionsresources list to be accessed. refer to the Scope in https://developer.accela.com/docsv3/ApisAbout
Since:
3.0

Authorize the user of the application. If the user has not authenticated with the Accela Mobile Cloud then the Login Dialog will be presented for the user to use to login. If the user has authenticated and still has a valid session the the user will be authorized without seeing the Login Dialog.

- (void) authorize: (NSArray *)  permissions
withAgency: (NSString *)  agency 

Authorizes the user of the application

The Login Dialog will be presented for the user to use to login if does not exit the valid token.

If the user has authenticated and still has a valid session the the user will be authorized without seeing the Login Dialog.

The schema of this app MUST be defined, and handleOpenURL MUST be invoked in the delegate of this app. refer to the method handleOpenURL of AccelaMobile.

Parameters:
permissionsresources list to be accessed. refer to the Scope in https://developer.accela.com/docsv3/ApisAbout
agencydefault agency name for the citizen App
Since:
3.0
- (void) authorizeAgencyApp: (2_0) 
(5_0)  NS_DEPRECATED_IOS 

Authenticates that the agency name, user name and password are valid for Agency App in native dialog.

Parameters:
permissionsresources list to be accessed. refer to the Scope in https://developer.accela.com/docsv3/ApisAbout
Deprecated:
Since:
1.0

Gets default instance

Since:
3.0
- (AMRequest *) downloadAttachment: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
localPath: (NSString *)  localFile
requestDelegate: (id<AMRequestDelegate>)  requestDelegate 

Downloads a binary file represented by an AMAttachmentModel object as an asynchronous operation.

Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
localPathThe path for file.
requestDelegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMRequestDelegate for information on the delegate protocol.
Returns:
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since:
1.0
- (id) fetchWithPath: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
error: (AMErrorBlock)  errorBlock 

Synchronously get a resource identified by the Accela Mobile Cloud API endpoint with the given parameters using an HTTP GET method.

Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
errorBlockAn AMErrorBlock object that will be called when there is an error during the method call.
Returns:
The resulting object is a JSON object, may be a dictionary or an array, if succeed; otherwise, nil.
Since:
1.0
- (id) fetchWithPath: (NSString *)  servicePath
urlParams: (NSMutableDictionary *)  params
httpMethod: (HTTP_METHOD)  httpMethod
data: (NSData *)  data
error: (AMErrorBlock)  errorBlock 

Synchronously get a resource identified by the Accela Mobile Cloud API endpoint with the given parameters using a given HTTP method.

Note that binary file data parameters are not yet supported by this function. Use downloadAttachment:requestDelegate: instead.

See also:
downloadAttachment:requestDelegate: for more information.
Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, or DELETE).
dataThe content sent with the coresponding request.
errorBlockAn AMErrorBlock object that will be called when there is an error during the method call.
Returns:
The resulting object is a JSON object, may be a dictionary or an array, if succeed; otherwise, nil.
Since:
1.0

A helper method that is used to provide an implementation for [UIApplicationDelegate applicationDidBecomeActive:] to properly resolve session state for the Accela Login flow, specifically to support app-switch login.

- (BOOL) handleOpenURL: (NSURL *)  url
sourceApplication: (NSString *)  sourceApplication
annotation: (id)  annotation 

Callback for oAuth in the App delegate when return from Accela oAuth web site.

Parameters:
urlThe URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]
sourceApplicationsourceApplication
annotationannotation
Since:
2.1
- (id) initWithAppId: (NSString *)  appId
withAppSecret: (NSString *)  appSecret 

Initializes a new AccelaMobile instance with the specified Application ID, get the value of the Application ID from the Accela Mobile Developer Portal.

Parameters:
appIdThe Accele Mobile application id. it is created and listed in https://developer.accela.com/ApplicationList/index
appSecretapp secret generated in Developer Portal
Returns:
Newly initialized Accele Mobile instance.
Since:
3.0
- (id) initWithAppId: (NSString *)  appId
withAppSecret: (NSString *)  appSecret
andDelegate: (id<AMSessionDelegate>)  delegate 

Initializes a new AccelaMobile instance with the specified Application ID. get the value of the Application ID from the Accela Developer Portal.

Parameters:
appIdThe Accele Mobile application id.it is created and listed in https://developer.accela.com/ApplicationList/index
appSecretapp secret generated in Developer Portal
delegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMSessionDelegate for information on the delegate protocol.
Returns:
Newly initialized Accele Mobile instance.
Since:
3.0
- (id) initWithAppId: (NSString *)  appId
withAppSecret: (NSString *)  appSecret
andDelegate: (id<AMSessionDelegate>)  delegate
withAuthHost: (NSString *)  authHost
withApiHost: (NSString *)  apiHost 

Initializes a new AccelaMobile instance with the specified Application ID. get the value of the Application ID from the Accela Developer Portal.

Parameters:
appIdThe Accele Mobile application id.it is created and listed in https://developer.accela.com/ApplicationList/index
appSecretapp secret generated in Developer Portal
delegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMSessionDelegate for information on the delegate protocol.
Parameters:
AccelaCivic Cloud host for auth. for example: https://auth.accela.com
AccelaCivic Cloud host for api. for example: https://apis.accela.com
Returns:
Newly initialized Accele Mobile instance.
Since:
3.0
- (id) initWithAppId: (NSString *)  appId
withAppSecret: (NSString *)  appSecret
withAuthHost: (NSString *)  authHost
withApiHost: (NSString *)  apiHost 

Initializes a new AccelaMobile instance with the specified Application ID, get the value of the Application ID from the Accela Mobile Developer Portal.

Parameters:
appIdThe Accele Mobile application id. it is created and listed in https://developer.accela.com/ApplicationList/index
appSecretapp secret generated in Developer Portal
AccelaCivic Cloud host for auth. for example: https://auth.accela.com
AccelaCivic Cloud host for api. for example: https://apis.accela.com
Returns:
Newly initialized Accele Mobile instance.
Since:
3.0
- (BOOL) isSessionValid

Checks if the session is available.

Returns:
YES if the session is valid, NO if it is invalid.
Since:
1.0
- (void) logout

Logs off the user from a session.

Since:
1.0
- (AMRequest *) requestWithPath: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
httpMethod: (HTTP_METHOD)  httpMethod
data: (NSString *)  data
attachments: (NSDictionary *)  attachments
requestDelegate: (id<AMRequestDelegate>)  requestDelegate 

Makes a HTTP form request to the Accela Mobile Cloud API endpoint with the given parameters using a given HTTP method as an asynchronous operation.

Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, or DELETE).
dataThe content sent with the coresponding request.
attachmentsattachments to be uploaded in the request. values mapping: Key = > File path
requestDelegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMRequestDelegate for information on the delegate protocol.
Returns:
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since:
2.1.1
- (AMRequest *) requestWithPath: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
httpMethod: (HTTP_METHOD)  httpMethod
data: (NSData *)  data
requestDelegate: (id<AMRequestDelegate>)  requestDelegate 

Makes a request to the Accela Mobile Cloud API endpoint with the given parameters using a given HTTP method as an asynchronous operation.

Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, or DELETE).
dataThe content sent with the coresponding request.
requestDelegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMRequestDelegate for information on the delegate protocol.
Returns:
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since:
1.0
- (AMRequest *) requestWithPath: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
requestDelegate: (id<AMRequestDelegate>)  requestDelegate 

Makes a request to the Accela Mobile Cloud API endpoint with the given parameters using an HTTP GET method as an asynchronous operation.

Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
requestDelegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMRequestDelegate for information on the delegate protocol.
Returns:
The AMRequest object corresponding to this API call.
Since:
1.0
- (AMRequest *) uploadAttachment: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
attachment: (NSDictionary *)  fileInformation
requestDelegate: (id<AMRequestDelegate>)  requestDelegate 

Uploads a binary file represented by an AMAttachmentModel object as an asynchronous operation.

Parameters:
servicePathThe path to the Accela Mobile Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
fileInformationA dictionary instance specifies the name of the file as well as the path of it. Note that the key value of the file name should be "fileName" and the key value of the file path should be "localPath".
requestDelegateThe receiver's delegate or nil if it doesn't have a delegate.
See also:
AMRequestDelegate for information on the delegate protocol.
Returns:
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since:
1.0

Property Documentation

- (NSString*) amApiHost [read, assign]

Gets the value of Accela apis host. for example: https://api.accela.com

Since:
3.0
- (NSString*) amAuthHost [read, assign]

Gets the value of Accela Civic Cloud host. for example: https://auth.accela.com

Since:
2.1
- (NSString*) amClientId [read, write, retain]

Gets the value of the application ID.

Since:
3.0
- (NSString*) amClientSecret [read, write, retain]

Gets or set the value of the application Secret.

Since:
3.0
- (ENVIRONMENT_TYPE) amEnvironmentType [read, write, assign]

Gets or sets the environment. It is required for Citizen app.

Since:
1.0
- (BOOL) amIsRemember [read, write, assign]

Gets or sets the value to indicate remember the login information. Default is yes.

Since:
3.0
- (NSDictionary*) httpHeaders [read, write, retain]

Add http headers for the requests

Deprecated:
Since:
3.0
- (id<AMSessionDelegate>) sessionDelegate [read, write, assign]

Gets or sets the delegate that will be called during user authentication.

Since:
1.0
- (NSDictionary*) userProfile [read, write, retain]

User profile: userName, ssotiket and so on.

Since:
2.1

The documentation for this class was generated from the following files:
 All Classes Functions Properties