PreEmptive Analytics iOS API  2.0
The official iOS API for sending PreEmptive Analytics data.
PreEmptive Analytics iOS API Documentation


This is the reference documentation for the PreEmptive Analytics API for iOS.

API Usage

The general usage is like so:

  • Include the PA_API.framework in your project.
  • Create a PAConfiguration object with your desired settings.
  • Create a PAClient object.
  • Call applicationStart to signal you are ready to send messages.
  • Call the appropriate methods on PAClient to generate messages:
    • featureTick to send a event occurrence.
    • featureStart and featureStop to record the duration of a non-instantaneous event.
    • systemProfile to record information about the executing environment.
    • performanceProbe to record cpu and memory usage.
    • reportException to record faults that occur at runtime.
  • Call applicationStop to signal you are done sending messages.

Message Queuing and Transmission

Messages are not immediately sent to the configured endpoint. The API queues messages and sends them when either a certain amount of time has elapsed or a number of messages have accumulated. On platforms where transmission may have performance impact, such as on mobile devices, the transmission of messages can be directly controlled by your program.

Message transmission is not guaranteed and messages may be lost. In cases of forced application shutdown or storage limitations the API may be unable to transmit queued messages or store them for off-line transmission. Messages may also be discarded if they overflow the API’s queue before they can be transmitted.

Off-line Storage

Your application is not required to always have network connectivity. You can configure the API to either always store the messages locally or to store them when contact with the configured endpoint is not possible. The API will automatically transmit these locally stored messages to the server when connectivity has been restored.

Multithreaded Use

The API supports requests from multiple threads. The API quickly handles the incoming requests and tries not to block the calling thread. The transmission of newly generated messages and stored messages takes place on background threads.


The API is designed with interoperability in mind.

Example Usage

Simple Objective-C Example

Add the PA_API framework to your project.

#import <PA_API/PAClient.h>
PAConfiguration* config = [[PAConfiguration alloc] initWithCompanyID:@"7D2B02E0-064D-49A0-BC1B-4BE4381C62D3"
PAClient* client = [[PAClient alloc] initWithConfiguration:config];
[client applicationStart];
[client featureTick:@"FromTheAPI"];
[client applicationStop];

Simple Swift Example

Add the PA_API framework to your project.

Add SwiftPAHeader.h as a bridging header.

let config = PAConfiguration(companyID:"7D2B02E0-064D-49A0-BC1B-4BE4381C62D3",
let client = PAClient(configuration:config)

Further Reading

Your copy of the PreEmptive Analytics API should have come with a User Guide that can guide you through utilizing all of the available features and message types.