Accela SDK for iOS  V3.2
 All Classes Functions Properties Pages
AccelaMobile Class Reference

#import <AccelaMobile.h>

Inheritance diagram for AccelaMobile:
<AMRequestDelegate>

Instance Methods

(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:
 
(AMRequest *) - downloadAttachment:urlParams:httpMethod:postData:localPath:requestDelegate:
 
- Instance Methods inherited from <AMRequestDelegate>
(void) - amRequestStarted:
 
(void) - amRequest:didReceiveResponse:
 
(void) - amRequest:didFailWithError:
 
(void) - amRequest:didLoad:
 
(void) - amRequest:receivedBytes:total:
 
(void) - amRequest:sendBytes:
 

Class Methods

(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.

Method 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/Resource/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/Resource/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/Resource/ApisAbout
Since
3.0
- (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/Resource/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/Resource/ApisAbout
Deprecated:
Since
1.0
+ (AccelaMobile *) defaultInstance

Gets default instance

Since
3.0
- (AMRequest*) downloadAttachment: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
httpMethod: (HTTP_METHOD)  httpMethod
postData: (NSString *)  data
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.
postDatapost data for the download request
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
3.1
- (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
- (void) handleDidBecomeActive

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
readnonatomicassign

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

Since
3.0
- (NSString*) amAuthHost
readnonatomicassign

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

Since
2.1
- (NSString*) amClientId
readwritenonatomicretain

Gets the value of the application ID.

Since
3.0
- (NSString*) amClientSecret
readwritenonatomicretain

Gets or set the value of the application Secret.

Since
3.0
- (ENVIRONMENT_TYPE) amEnvironmentType
readwritenonatomicassign

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

Since
1.0
- (BOOL) amIsRemember
readwritenonatomicassign

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

Since
3.0
- (NSDictionary*) httpHeaders
readwritenonatomicretain

Add http headers for the requests

Deprecated:
Since
3.0
- (id<AMSessionDelegate>) sessionDelegate
readwritenonatomicassign

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

Since
1.0
- (NSDictionary*) userProfile
readwritenonatomicretain

User profile: userName, ssotiket and so on.

Since
2.1

The documentation for this class was generated from the following file: