Authors: Max Alexander, [email protected] & David Spector, [email protected]
RChat is a general purpose chat client that can be used either as a stand-alone chat system (i.e., an app unto itself) or as an embedded chat view that can be quickly and easily added to any exiting application to provide an off-line first chat capability.
- Xcode 8.33 or higher
- Realm Object Server 2.0.11 or higher
- Cocoapods
- Nodejs v8.6 or higher
- Node Package Manager (npm)
The RChat iOS app uses Cocoapods to set up the project's 3rd party dependencies. Installation can be directly (from instructions at the Cocapods site) or alternatively through a package management system like Homebrew.
This application demonstrates features of the Realm Platform and needs to have a working instance of the Realm Object Server version 2.x to make data available between instances of the RChat app. The Realm Object Server can be installed via npm as a node application for macOS or Linux. Please see the installation instructions.
This repo also has a minimal server suitable for testing whose only requirement for pre-existing software is nodejs and npm. Installation/setup/operation of this server is convered in the installation section below.
Another useful tool is Realm Studio which is available for macOS, Linux and Windows and allows developers to inspect and manage Realms and the Realm Object Server. Realm Studio is recommended for all developers and can be downloaded from the Realm web site.
The RChat iOS app makes use of a number of 3rd party modules:
Clone this repository git clone https://github.com/realm/roc-ios
to a convenient location your machine.
This application comes with a demo server against which you can run the RChat client. The ROS platform requires NodeJS version 8.5 or higher and the npm node package manager installed in order to be able to run. If these are already installed, continue with the instructions below, if you need further info on nodejs or NPM installaton, please see their repsective web sites for installation instructions.
- Open a new terminal window
- Change directory to the download location where you downloaded the RChat repository
- Change directory to the
RChatMinimalServer
directory - Install the required node server modules by running
npm install
- Run the node server with the command
node .
in the same same director
Since this is client focued demo, there is not a back-end server that sets up the RChat Realm or its permissions. In order to ensure the Realm permissions are correctly set the first user that logs in using the RChat service needs to be a Realm Server Administrator user.
To accomplish this, launch Realm Studio and create one user that will be "user #1" for RChat and grant that user Server Administrator permission. This is done by creating a new user or editing an existing user and then setting the administrator permission in the User Panel as shown here:
- Change directory to the
RChart-iOS
directory - Run
pod update
- Open the workspace
open RChat.xcworkspace
with Xcode
By default the iOS client points to the local machine as its ROS server. if you have set up a ROS server on a different machine, you will need to edit the server IP address in the file RChatConstants.swift
(which is in the RChat/Data
directory) and replace the IP address for the Realm Server address with you server IP.
- Run the app by selecting a simulator from Xcode's menu, and the press Build & Run; the simulator will start and you can log in to the chat server using the username and password you created above using Realm Studio.
RChat Data Model - Realm Studio View
RChat Screen Shot
See CONTRIBUTING.md for more details!
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
Distributed under the Apache 2.0 license. See LICENSE for more information.