Lightstreamer - Basic Chat Demo - iOS Client - Swift
The Chat Demo is a very simple chat application based on Lightstreamer.
This project contains an example of an application for iPhone that employs the Lightstreamer iOS Client library, with use of mobile push notifications (MPN).
This app, compatible with iPhone, is a Swift version of the Lightstreamer - Basic Chat Demo - HTML Client.
This app uses the iOS Client API for Lightstreamer to handle the communications with Lightstreamer Server. A simple user interface is implemented to display the real-time messages received from Lightstreamer Server. Additionally, the app is able to forward incoming messages via mobile push notifications to any registered client.
Further details about developing apps on iOS with Lightstreamer and MPNs are discussed in this blog post:
Binaries for the application are not provided.
Binaries for the application are not provided, but a full Xcode project specification is provided. Please recall that you need a valid iOS Developer Program membership to debug or deploy your app on a test device.
Before you can build this demo, you need to install CocoaPods to handle the project dependency on the Lightstreamer iOS client library (see also the Lightstreamer Compatiblity Notes below).
Follow these steps:
- open a terminal and run the following command:
$ sudo gem install cocoapods
cdinto the directory where you downloaded this project and run the following command:
$ pod install
- CocoaPods should now resolve the dependency on the Lightstreamer iOS client library and prepare a workspace for you.
Done this, open the workspace with Xcode and it should compile with no errors. In case of errors during dependency resolution, you can find more information on CocoaPods official website.
Compile and Run
A full local deploy of this app requires a Lightstreamer Server 7.0 or greater installation with appropriate Mobile Push Notifications (MPN) module configuration. A detailed step by step guide for setting up the server and configuring the client is available in the README of the following project:
Lightstreamer Adapters Needed by This Demo Client
- Lightstreamer - Basic Chat Demo - Java Adapter
- Lightstreamer - MPN Chat Demo Metadata - Java Adapter
More informations on developing Lightstreamer apps with iOS and MPN:
- Lightstreamer - Basic Chat Demo - HTML Client
- Lightstreamer - Stock-List Demo - iOS Client
- Lightstreamer - Stock-List Demo with APNs Push Notifications- iOS Client
Lightstreamer Compatibility Notes
- Compatible with Lightstreamer iOS Client Library version 4.0.0 or newer.
- For Lightstreamer Server version 7.0 or greater. Ensure that iOS Client API is supported by Lightstreamer Server license configuration.
- For a version of this example compatible with Lightstreamer iOS Client API version 3.x and Server version 6.1, please refer to this tag.