Hi All,
I have successfully created and offline hybrid application using the below link
Now I am trying to use delta token in my offline Hybrid application(using Master detail template and custom OData service).
For the same we have created an OData service(supports delta token)with entity set parentSet .
ondelta: function () {
var oModel = this.getOwnerComponent().getModel();
var that = this;
var success = function (data, response) {
var a, b, c, d;
a = response.body.lastIndexOf("!deltatoken");
b = response.body.slice(a);
c = b.split("'");
d = c[0] + "'" + c[1] + "'";
that.deltatoken = d;
};
// var oHeaders = {};
// oHeaders.Accept = "application/xml";
var error = function () {
sap.m.MessageToast.show("error");
};
var mParameters = {};
// mParameters.serviceUrlParams = {
// 'deltatoken': this.deltatoken
// };
mParameters.urlParameters = this.deltatoken;
mParameters.success = success;
mParameters.error = error;
oModel.oHeaders.Accept = "application/xml";
var sUrl = "/parentSet";
// sUrl = sUrl + this.deltatoken;
oModel.read(sUrl, mParameters);
oModel.oHeaders.Accept = "application/json";
}
This is working when we run the application on the desktop from the webIDE ( getting the delta token and using that to make the next service call. As a response we get the newly created or changed entries only)
When we create a packaged app and try to test the same scenario it do not work( we are not getting delta token itself)
Please let me know if there is any way we can implement the delta token for the hybrid offline mobile app.
Thanks,
KBS