Travel Sample Mobile App
Pre-requisites
-
Xcode 10.1+: downloadable latest version from the Mac App Store.
-
swift 5
Getting Started
-
Clone the "master" branch of the Travel Sample app from GitHub. We are doing a shallow pull with
depth
as 1 to speed the cloning process.git clone -b master --depth 1 https://github.com/couchbaselabs/mobile-travel-sample.git
You will have to download the compatible version of Couchbase Lite framework
-
In Terminal, navigate to the TravelSample directory.
cd /path/to/mobile-travel-sample/ios/TravelSample
-
Run the following script to download and install Couchbase Lite. A script is provided to install Couchbase Lite comatible with different versions of Xcode and Swift.
-
Open the
TravelSample.xcodeproj
using Xcode
Configure App to connect to Backend
You will have to update the URLs specified in the app to connect to the backend If you haven’t done so already, complete the steps outlined in the "Backend Installation" to install your Couchbase Server, Sync Gateway and Python web backend app.
Updating the web backend URL
Open the file QueryConsts.swift
.
You must update the webUrl
constant which points to the Python Web Server.
Now, the URLs that you specify will vary depending on the installation option that you chose for deploying your backend
static var webUrl:String = "http://localhost:8080"
static var webUrl:String = "http://127.0.0.1:8080/"
// Replace the hostname with the IP Address of the RightScale instance.
// The example states `54.148.83.39` but yours will be different.
static var webUrl:String = "http://54.148.83.39:8080/"