Classes

The following classes are available globally.

  • Used by LightstreamerClient to provide a basic connection properties object.

    This object contains the configuration settings needed to connect to a Lightstreamer Server.

    An instance of this class is attached to every LightstreamerClient as LightstreamerClient.connectionDetails.

    See more

    Declaration

    Swift

    public class ConnectionDetails : CustomStringConvertible
  • Used by LightstreamerClient to provide an extra connection properties object.

    This object contains the policy settings used to connect to a Lightstreamer Server.

    An instance of this class is attached to every LightstreamerClient as LightstreamerClient.connectionOptions.

    See more

    Declaration

    Swift

    public class ConnectionOptions : CustomStringConvertible
  • Concrete logger class to provide logging on the system console.

    Instances of this classes are obtained by the library through the LSLoggerProvider instance set on LightstreamerClient.setLoggerProvider(...).

    See more

    Declaration

    Swift

    public class ConsoleLogger : LSLogger
  • Simple concrete logging provider that logs on the system console.

    To be used, an instance of this class has to be passed to the library through the LightstreamerClient.setLoggerProvider(...).

    See more

    Declaration

    Swift

    public class ConsoleLoggerProvider : LSLoggerProvider
  • Façade class for the management of the communication to Lightstreamer Server.

    Used to provide configuration settings, event handlers, operations for the control of the connection lifecycle, subscription handling and to send messages.

    See more

    Declaration

    Swift

    public class LightstreamerClient
  • Utility class that provides methods to build or parse the JSON structure used to represent the format of a push notification.

    It provides properties and methods to get and set the fields of a push notification, following the format specified by Apple’s Push Notification service (APNs). This format is compatible with MPNSubscription.notificationFormat.

    See more

    Declaration

    Swift

    public class MPNBuilder
  • Class representing a device that supports Mobile Push Notifications (MPN).

    It contains device details and the delegate needed to monitor its status.

    An MPN device is created from a device token obtained from system’s Remote User Notification APIs, and must be registered on the LightstreamerClient in order to successfully subscribe an MPN subscription. See MPNSubscription.

    After creation, an MPNDevice object is in “unknown” state. It must then be passed to the Lightstreamer Server with the LightstreamerClient.register(forMPN:) method, which enables the client to subscribe MPN subscriptions and sends the device details to the server’s MPN Module, where it is assigned a permanent <deviceId> and its state is switched to “registered”.

    Upon registration on the server, active MPN subscriptions of the device are received and exposed in the LightstreamerClient.MPNSubscriptions collection.

    An MPNDevice’s state may become “suspended” if errors occur during push notification delivery. In this case MPN subscriptions stop sending notifications and the device state is reset to “registered” at the first subsequent registration.

    See more

    Declaration

    Swift

    public class MPNDevice : CustomStringConvertible
  • Class representing a Mobile Push Notifications (MPN) subscription to be submitted to the MPN Module of a Lightstreamer Server.

    It contains subscription details and the delegate needed to monitor its status. Real-time data is routed via native push notifications.

    In order to successfully subscribe an MPN subscription, first an MPNDevice must be created and registered on the LightstreamerClient with LightstreamerClient.register(forMPN:).

    After creation, an MPNSubscription object is in the “inactive” state. When an MPNSubscription object is subscribed to on an LightstreamerClient object, through the LightstreamerClient.subscribeMPN(_:coalescing:) method, its state switches to “active”. This means that the subscription request is being sent to the Lightstreamer Server. Once the server accepted the request, it begins to send real-time events via native push notifications and the MPNSubscription object switches to the “subscribed” state.

    If a triggerExpression is set, the MPN subscription does not send any push notifications until the expression evaluates to true. When this happens, the MPN subscription switches to “triggered” state and a single push notification is sent. Once triggered, no other push notifications are sent.

    When an MPNSubscription is subscribed on the server, it acquires a permanent subscriptionId that the server later uses to identify the same MPN subscription on subsequent sessions.

    An MPNSubscription can be configured to use either an Item Group or an Item List to specify the items to be subscribed to, and using either a Field Schema or Field List to specify the fields. The same rules that apply to Subscription apply to MPNSubscription.

    An MPNSubscription object can also be provided by the client to represent a pre-existing MPN subscription on the server. In fact, differently than real-time subscriptions, MPN subscriptions are persisted on the server’s MPN Module database and survive the session they were created on.

    MPN subscriptions are associated with the MPN device, and after the device has been registered the client retrieves pre-existing MPN subscriptions from the server’s database and exposes them in the LightstreamerClient.MPNSubscriptions collection.

    See more

    Declaration

    Swift

    public class MPNSubscription : CustomStringConvertible
  • Class representing a real-time subscription to be submitted to a Lightstreamer Server.

    It contains subscription details and the delegates needed to process the real-time data.

    After the creation, an Subscription object is in the “inactive” state. When an Subscription object is subscribed to on a LightstreamerClient object, through the LightstreamerClient.subscribe(_:) method, its state becomes “active”. This means that the client activates a subscription to the required items through Lightstreamer Server and the Subscription object begins to receive real-time events.

    An Subscription can be configured to use either an Item Group or an Item List to specify the items to be subscribed to and using either a Field Schema or Field List to specify the fields.

    “Item Group” and “Item List” are defined as follows:

    • “Item Group”: an Item Group is a String identifier representing a list of items. Such Item Group has to be expanded into a list of items by the getItems method of the MetadataProvider of the associated Adapter Set. When using an Item Group, items in the subscription are identified by their 1-based index within the group. It is possible to configure the Subscription to use an “Item Group” using the itemGroup property.

    • “Item List”: an Item List is an array of Strings each one representing an item. For the Item List to be correctly interpreted a LiteralBasedProvider or a MetadataProvider with a compatible implementation of getItems has to be configured in the associated Adapter Set. Note that no item in the list can be empty, can contain spaces or can be a number. When using an Item List, items in the subscription are identified by their name or by their 1-based index within the list. It is possible to configure the subscription to use an “Item List” using the items property or by specifying it in the constructor.

    “Field Schema” and “Field List” are defined as follows:

    • “Field Schema”: a Field Schema is a String identifier representing a list of fields. Such Field Schema has to be expanded into a list of fields by the getFields method of the MetadataProvider of the associated Adapter Set. When using a Field Schema, fields in the subscription are identified by their 1-based index within the schema. It is possible to configure the Subscription to use a “Field Schema” using the fieldSchema property.

    • “Field List”: a Field List is an array of Strings each one representing a field. For the Field List to be correctly interpreted a LiteralBasedProvider or a MetadataProvider with a compatible implementation of getFields has to be configured in the associated Adapter Set. Note that no field in the list can be empty, or can contain spaces. When using a Field List, fields in the subscription are identified by their name or by their 1-based index within the list. It is possible to configure the Subscription to use a “Field List” using the fields property or by specifying it in the constructor.

    See more

    Declaration

    Swift

    public class Subscription : CustomStringConvertible