© 2011 Midnight Coders, Inc.
Communication Library for iOS User Guide
All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or
mechanical, including photocopying, recording, taping, or information storage and retrieval systems - without the
written permission of the publisher.
Products that are referred to in this document may be either trademarks and/or registered trademarks of the
respective owners. The publisher and the author make no claim to these trademarks.
While every precaution has been taken in the preparation of this document, the publisher and the author assume no
responsibility for errors or omissions, or for damages resulting from the use of information contained in this
document or from the use of programs and source code that may accompany it. In no event shall the publisher and
the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused
directly or indirectly by this document.
Printed: July 2011 in (whereever you are located)
Communication Library for iOS User Guide
© 2011 Midnight Coders, Inc.
Publisher
Special thanks to:
All the people who contributed to this document, to everyone who
has helped us out with the vision for the product, feature
suggestions and ideas for improvements. Special thanks to our
families for your support, encouragement and patience.
Midnight Coders, Inc.
3Contents
3
© 2011 Midnight Coders, Inc.
Table of Contents
Foreword 0
Part I Overview
4
Part II Integration Types
5
Part III Requirements
6
Part IV Creating RTMP Connection
7
Part V Connection Events
8
Part VI Invoke Server Methods
9
Part VII Server Data Push
12
Part VIII Remote Shared Objects
13
Part IX Supported Servers
15
................................................................................................................................... 151 WebORB for .NET
................................................................................................................................... 192 WebORB for Java
................................................................................................................................... 233 Adobe Flash Media Server
................................................................................................................................... 234 Wowza Media Server
Part X Class Library API
24
................................................................................................................................... 241 RTMPClient
................................................................................................................................... 262 IRTMPClientDelegate
................................................................................................................................... 263 IPendingServiceCallback
................................................................................................................................... 264 IClientSharedObject
................................................................................................................................... 275 ISharedObjectListener
................................................................................................................................... 296 IAttributeStore
................................................................................................................................... 317 IServiceCall
Index 0
Communication Library for iOS User Guide4
© 2011 Midnight Coders, Inc.
1 Overview
Communication Library for iOS - is a reusable, native iOS library component enabling developers to
quickly and easily connect the iOS applications with server-side technologies. Most of the enterprise
and consumer mobile applications require client-server connectivity. The most trivial scenario is when the
data is loaded from the server by the client, however, most modern applications call for more advanced
integration. This includes instant or real-time data availability, data push and sophisticated, multi-user
interaction. The library facilitates all of these scenarios. Using the communication library for iOS
developers can easily accomplish the following tasks:
Integrate iPhone and iPad applications with existing server-side infrastructure which may be
developed in Java, .NET or server-side ActionScript.
Easily leverage server-side APIs and connect to them from the iOS devices.
Efficiently transfer data from the client application to services running in private data centers on in
the cloud.
Implement real-time data push strategies and deliver real-time updates from Java, .NET or server-
side ActionScript code to iOS devices.
Create multi-user applications where the data can be easily exchanged between multiple application
instances.
Integrate mobile applications using the library with their browser or desktop-based counterparts. This
makes it possible to enable users using the mobile application to interact in real-time with the users
using the browser or desktop-based version of the same application.
The library provides significant advantages over the competing approaches:
The on-the-wire protocol implemented by the library is highly optimized and very efficient. This
guarantees small payload for the messages which enables efficient communication not only over wi-
fi, but also via the 3G networks.
No vendor lock-in. The library is built in a neutral way without tying the application to a particular
server-side technology or vendor.
Intuitive, well-documented API.
Integration Types 5
© 2011 Midnight Coders, Inc.
2 Integration Types
Currently the library enables client-server integration via the RTMP protocol. That means to enable client-
server communication, the library creates a persistent connection with an RTMP server. The connection
is used by both the library and the server to exchange data and handle client-to-server and server-to-
client method invocations. There are multiple implementations of the RTMP servers available on the
market. See the Supported Servers section for additional information.
Note: A future version of the library will provide an alternative integration type which will enable client-
server connectivity via HTTP-based remote method invocation.
The diagram below provides a visual overview of how the library fits into the client application and
communicates with an RTMP server: