O'Reilly logo

Mobile and Web Messaging by Jeff Mesnil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Mobile Messaging with STOMP

In this chapter, we will write our first messaging client: an native application running on an iPhone. We will use STOMP to send and receive messages using the Objective-C library StompKit.

In Locations Application Using STOMP, we described the Locations application. In this chapter, we will write the iOS application that broadcasts the device’s position and receive text messages.

Diagram of the Locations iOS application
Figure 2-1. Diagram of the Locations iOS application

About the Code

All along the chapter, we will show all the code required to run the application.

The whole application code can be retrieved from the GitHub repository in the stomp/ios/ directory.

StompKit

To use STOMP on iOS, we will use the StompKit Objective-C library that implements the STOMP protocol in a modern event-driven way using ARC, Grand Central Dispatch and blocks.

The source code of this library project is hosted on GitHub.

Create the Locations Project with Xcode

We will use Xcode to create the Locations iOS application.

Once Xcode is installed and started, we create a new project from its launch screen:

XCode Launch screen
Figure 2-2. Select Create a new Xcode project from Xcode launch screen.

The application consists in a single view so we choose the Single View Application template in iOs > Application from the template screen.

Figure 2-3. Select ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required