-
Notifications
You must be signed in to change notification settings - Fork 7
Home
If you are building the module from source, see Building.
Requirements for version 1.1 of the module:
- The Couchbase Mobile 2.0.0 framework
- XCode with iPhone OS SDK 5.0 or later
-
Download com.obscure.couchbaseti-iphone-1.1.zip and place it in your Titanium directory (usually ~/Library/Application Support/Titanium).
-
Follow these instructions to fetch and build the Couchbase Mobile framework for iOS. You may want to set up an admin username and password by adding the following to Resources/default_ios.ini:
[admins] admin = mysecretadminpassword
-
Copy the
Couchbase.framework
directory to ~/Library/Frameworks. Your app will be linked against this framework at build time.
-
Download com.obscure.couchbaseti-android-1.1.zip and place it in your Titanium directory (usually ~/Library/Application Support/Titanium).
-
If you are using JavaScript views in your project, make sure you run the app on an emulator AVD with a CPU set to armeabi-v7a.
To use the couchbase_ti module in your project:
-
Create a mobile project in Titanium Developer if you have not done so already, then cd into your project directory.
-
Edit tiapp.xml and add the module declarations as follows:
<modules> <module platform="iphone" version="1.1">com.obscure.CouchbaseTi</module> <module platform="android" version="1.1">com.obscure.CouchbaseTi</module> </modules>
-
Edit your app.js file and add the following to load and start the Couchbase server:
var server = require('com.obscure.CouchbaseTi'); var serverUrl; server.addEventListener("com.obscure.couchbase_ti.server_started", function(e) { serverUrl = e.serverUrl; }); server.startCouchbase();
-
Build and run the app. You should see the following in the log:
[DEBUG] couchbase started on http://0.0.0.0:64545/
The port number will be different on each run, which is why you have to save the server URL as shown in the preceding step. If Titanium has a problem finding the module, try unzipping the
com.obscure.couchbase_ti-*-1.1.zip
file.