I went into this expecting a challenge but it was easy. Basically, Couchbase Lite has always had an optional HTTP listener that you can connect to from inside your app at http://lite.couchbase./mydatabase/
. React Native has a fine XHR module and encourages using fetch so getting your app to sync can be as easy as adding some API calls to keep JSON in the database.
We haven't done a full example yet, but in the spirit of possiblity, here are quick instructions to connect Couchbase Lite iOS with a React Native app (generated from their cli).
- Download and unzip Couchbase Lite iOS (grep this page for
ios
) - Drag and drop BOTH frameworks (CouchbaseLite.framework and CouchbaseLiteListener.framework) into your React Native app Xcode sidebar. More about the Listener capabilities in this blog post about peer to peer apps.
- Add the library dependenc