Describing iOS Framework Methods

To develop a mobile application, requests to mobile platform server use iOS framework methods of the HHFWController main class.

The most of methods are executed asynchronously in a background stream. To display request execution result, send the "hander" closure of the HHFWCompletionHandler? type to the method that is automatically called in the main stream after method execution.

NOTE. Before executing methods execute authentication on a mobile platform server by login and password or with password change. To work with a local database and resources, open connection and load resources schemes, otherwise methods will call the "handler" closure with the Null parameter.

Authentication Methods

Authenticate user by login and password (auth)

User authentication with password change (auth)

Checking LDAP Use by SSL Protocol (setSSLChecks)

Cancel authentication (unAuth)

The use of methods is given in the Examples of Authentication on Mobile Platform Server section.

Server Availability Check Method

Mobile platform server availability check (connectionStatus)

The method use is given in the Example of Mobile Platform Server Availability Check section.

Methods for Working with Local Database

Open or create a database (openBase)

Change database encryption key (rekeyBase)

SQL query to database (query)

Get table names (getTablesName)

Delete tables from database (dropCache)

Close database (closeBase)

The use of methods is given in the Examples of Working with Resources section.

Methods for Working with Resources

Load resources scheme (resources)

Synchronous delta loading to database (deltaStream)

Asynchronous delta loading to database (deltaStreamAsync)

Synchronous table data loading to database (tableStream)

Asynchronous table data loading to database (tableStreamAsync)

Synchronous getting resource table data without loading to database (table)

Asynchronous getting resource table data without loading to database (tableAsync)

Synchronous request to resource without loading to database (request)

Asynchronous request to resource without loading to database (requestAsync)

Set the path to the folder with files of the current resource downloading state (setDownloadPath)

Resume resource downloading (useDownload)

The use of methods is given in the Examples of Working with Resources section.

Methods for Working with Push Notifications

To work with push notifications, use a mobile device, prepare the application to get push notifications and determine a device token.

To send push notifications from a mobile platform server to a mobile device, generate Apple Push Services certificate based on the certificates obtained in Apple Developer Account:

  1. Download the required certificate from the developer account and add it to Keychain Access.

  2. Open the certificate in Keychain Access.

  3. Select the certificate and the closed key, export them to the required location with the *.p12 extension.

  4. In the terminal go to the directory with exported file and convert it into the file with the *.pem extension.

cd Desktop // directory that contains exported file, for example, in the desktop
openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts
  1. Add the certificate in the Apple Push Notification Service section when setting up push notifications.

For details about queries to send push notifications see the Method of Working with Push Notifications section.

Get list of active tokens (getTokens)

Send token to server (addToken)

Remove tokens from server (removeTokens)

Get message topics list (getTopics)

Set path to certification authority certificate file (setCAPemFilePath)

Subscribe to messages (subscribeTopics)

Unsubscribe from messages (unsubscribeTopics)

The use of methods is given in the Example of Working with Push Notifications section.

Methods for Working with Files

Before executing the methods set up connection to folder on file server and add a permission to load data in the Info.plist in the mobile application project:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Get information about directory contents (getDirectory)

Get file information (getFileMeta)

Download file from server (getFile)

Upload file to server (putFile)

Delete file from server (deleteFile)

Methods for Working with Data Encryption

Check encryption key (checkPassword)

Decrypt file to a new file (decryptFile)

Decrypt file to string (decryptFileToString)

Decrypt file to byte buffer (decryptFileToData)

Decrypt string to file (decryptString)

Decrypt string to new string (decryptStringToString)

Local byte buffer encryption to file (encryptData)

Local file encryption to new file (encryptFile)

Local file encryption to string (encryptFileToString)

Local string encryption to file (encryptString)

Local string encryption to a new string (encryptStringToString)

The use of methods is given in the Example of Working with File Encryption section.

Method for Working with Transactions

For details about sending transaction data see the Sending Transaction Data section.

Get all transactions list (getAllTransactions)

Get response by transaction ID (getTransaction)

Repeated query with specifying transaction ID to get table data (retryTable)

Repeated query with specifying transaction ID for asynchronous getting table data without loading to database (retryTableAsync)

Repeated query with specifying transaction ID for synchronous loading of table data to database (retryTableStream)

Repeated query with specifying transaction ID for asynchronous loading of table data to database (retryTableStreamAsync)

Delete transaction information (deleteTransaction)

The use of methods is given in the Example of Working with Transactions section.

Methods fort Working with Digital Signature

Before executing the methods set up parameters of connection to DSS CryptoPro.

Get certificates list (getCertificatesWithPassword)

Get digital signatures history (signs)

Send document to sign (signCertificate)

Remove digital signature (remove)

The use of methods is given in the Example of Working with Digital Signature section.

Methods for Working with WEB Resources

Access to WEB resources is made as via proxy. A mobile platform server is used as a mediator between a mobile device and WEB resources.

Before executing the method make sure that the connection is opened with local database, and resources schemes are loaded.

Universal WEB resource request (webRequest)

Use the POST HTTP method on request to WEB resource (webPost)

Use the GET HTTP method on request to WEB resource (webGet)

Use the TRACE HTTP method on request to WEB resource (webTrace)

Use the HEAD HTTP method on request to WEB resource (webHead)

Use the PUT HTTP method on request to WEB resource (webPut)

Use the DELETE HTTP method on request to WEB resource (webDelete)

Use the PATCH HTTP method on request to WEB resource (webPatch)

Use the OPTIONS HTTP method on request to WEB resource (webOptions)

Methods for Working with Foresight Analytics Platform

Accessing Foresight Analytics Platform is executed identically to accessing WEB resources.

Request to Foresight Analytics Platform (request)

The method use is given in the Example of Working with Foresight

Methods for Working with Logging

Write error to log (logFatal)

Write message to log (logTrace)

Write warning to log (logWarning)

Set path to logs database (setLogDBPath)

Display framework log in the console (setLogEnabled)

Set logging level (setLogLevel)

Send logs to mobile platform server (syncLogs)

Get logs synchronization schedule (syncLogsSchedule)

Methods for Working with State

Get state (state)

Set state (setState)

See. also:

HHFW Framework | Examples of iOS Framework Use