Initialize Kony Fabric client with the following code, and start using the services provided in Kony Fabric. The initialization method fetches the configuration from Kony Fabric and saves in the cache. Later, the application uses the cached configuration. It is a synchronous call.
When SDK is initialized, the Kony SDK registers a session and sends its information to the Kony Fabric Server. If the device is offline, or the server is not reachable, the session information persists on the device until it can successfully send the information to the Kony Fabric server.
For more information on application session, refer Standard Report Docs.
To disable response caching, set the Pragma header (as a global request header) to no-cache by using the setGlobalRequestParam() API.
//Sample code to initialize Kony Fabric Client var appkey = < your - app - key > ; var appsecret = < your - app - secret > var serviceURL = < your - service - url > ; var client = new kony.sdk(); //set Pragma Header to disable the use of response cache in browsers. client.setGlobalRequestParam("Pragma", "no-cache", client.globalRequestParamType.headers); client.init(appkey, appsecret, serviceURL, function(response) { console.log("Init success"); }, function(error) { console.log("Init Failure"); });
Copyright © 2020 Kony, Inc. All rights reserved. |