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 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)

Cancel authentication (unAuth)

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

Server Accessibility Check Method

Mobile platform server accessibility check (connectionStatus)

The method use is given in the Example of Mobile Platform Server Accessibility Check example.

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 examples 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)

Sychronous request to resource without loading to database (request)

Asynchronous request to resource without loading to database (requestAsync)

Resume resource downloading (useDownload)

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

The use of methods is given in examples 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 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)

Subscribe to messages (subscribeTopics)

Unsubscribe from messages (unsubscribeTopics)

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

Methods of Working with Files

Before executing the methods set up connection to folder at file server and add a permissions 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)

Decrypt file to a new file (decryptFile)

Decrypt file to string (decryptFileToString)

Decrypt file to byte buffer (decryptFileToData)

Delete file from server (deleteFile)

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

Method for Working with Transactions

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

Get all transactions list (getAllTransactionResourceName)

Get response by transaction ID (getTransaction)

Repeated query with specifying transaction ID (retryTable)

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. The mobile platform server is used as an intermediary 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.

Request to WEB resources (request)

The method use is given in the Example of Working with WEB Resources section.

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 Analytics Platform. section.

Methods for Working with Logging

Set logging level (setLogLevel)

Display framework log in the console (setLogEnabled)

See also:

iOS Framework | Initializing iOS Framework | Examples of iOS Framework Use