I tested syncing on Android (version 5.1.1) and iOS (version 12.2) on real device.
On Android, everything works fine, but on iOS pushing data to the server database does not work, though pulling new data from server works.
Here is my sync code in app.js:
const application = require("tns-core-modules/application");
const Couchbase = require('nativescript-couchbase-plugin').Couchbase;
const stock = new Couchbase('stock-database');
const push = stock.createPushReplication(
'ws://192.168.88.61:4984/stock-database'
);
push.setUserNameAndPassword("sync","654321");
const pull = stock.createPullReplication(
'ws://192.168.88.61:4984/stock-database'
);
pull.setSessionId("SomeId");
pull.setSessionIdAndCookieName("SomeId","SomeCookieName");
push.setContinuous(true);
pull.setContinuous(true);
push.start();
pull.start();
module.exports.stock = stock;
const bestseller = new Couchbase('bestseller-database');
const push2 = bestseller.createPushReplication(
'ws://192.168.88.61:4984/bestseller-database'
);
push2.setUserNameAndPassword("sync","654321");
const pull2 = bestseller.createPullReplication(
'ws://192.168.88.61:4984/bestseller-database'
);
pull2.setSessionId("SomeId");
pull2.setSessionIdAndCookieName("SomeId","SomeCookieName");
push2.setContinuous(true);
pull2.setContinuous(true);
push2.start();
pull2.start();
module.exports.bestseller = bestseller;
application.run({ moduleName: "app-root/app-root" });
Couchbase Server 6.0.0 community edition and Sync Gateway 2.5 community edition are installed and in use on Windows 10 laptop.
I use NativeScript and Couchbase Plugin for making the app.
The plugin wraps Couchbase Lite community version 2.1.1