MigratoryData Client API for iOS
Developer's Guide and Reference Manual
Developer's Guide

This guide includes the following sections:


This application programming interface (API) contains all the necessary operations for connecting to a cluster of one or more MigratoryData servers, subscribing to subjects, getting real-time messages for the subscribed subjects, and publishing real-time messages.

Before reading this manual, it is recommended to read MigratoryData Architecture Guide (PDF, HTML).

Creating iOS clients for MigratoryData Server

A typical API usage is as follows:

Step 1 - Include the library.

Include the headers of the API located in the folder lib of this API package.

Add the lib folder to the Include Directories of your iOS application.

The API library is available in the folder lib of this API package. Add the lib folder to the Library Directories of your iOS application. Also, add the API library itself to the list of Library Dependencies of your iOS application.

Step 2 - Define the listener class to get the real-time messages and status notifications.

The listener should implement the MigratoryDataListener interface.

Use the API call MigratoryDataClient::setListener: to attach your listener implementation.

Step 3 - Specify the list of MigratoryData servers where to connect to.

Use the API method MigratoryDataClient::setServers: to specify one or more MigratoryData servers to which your iOS client will connect to. In fact, the iOS client will connect to only one of the MigratoryData servers in this list. But, defining two or more MigratoryData servers is recommended to achieve fail-over (and horizontal scalling / load balancing). Supposing the MigratoryData server - to which the iOS client connected - goes down, then the API will automatically reconnect that client to another MigratoryData server in the list.

Step 4 Subscribe to subjects and publish messages

Use the API method MigratoryDataClient::subscribe: to subscribe to subjects and use the API method MigratoryDataClient::publish: to publish messages.

Step 5 - Handle the real-time messages and status notifications.

Handle the messages received for the subscribed subjects as well as the status notifications in your listener implementation defined at Step 2 above.


Examples built with this API are available in the folder examples of this API package; start with the README file which explains how to compile and run them.