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 authenticatin by means of the auth method. 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)

Cancel authentication (unAuth)

The use of methods is given in the Example of Authentication at Mobile Platform Server example.

Methods for Working with Local Database

Open or create a database (openBase)

SQL query to database (query)

Get table name (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 of Working with Resources

Load resources scheme (resources)

Load delta to database (deltaStream)

Load table data to database (tableStream)

Get resource table data without loading to database (table)

Request to resource without loading to database (request)

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)

Delete file from server (deleteFile)

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

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)

See also:

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