Perform the following steps to initialize the .NET SDK.
Kony.SDK sdkObject = new Kony.SDK();
Use the methods and properties of the SDK class to initialize and access the .NET SDK.
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.
Note: The .NET SDK does not support the Messaging Service or the Sync Service.
Note: The sessions created by .NET Fabric SDK are interactive.
To start using the services provided in use the Init() method of the SDK class. This method may take several seconds to execute, so it is available as either a synchronous or asynchronous call.
This method fetches the app configuration from the Kony server and saves it in the cache. Later, the application uses the cached configuration. This method must be invoked before invoking any other SDK method.
Synchronous
JObject Init(string appKey, string appSecret, string serviceUrl)
Asynchronous
async Task<JObject> InitAsync(string appKey, string appSecret, string serviceUrl)
appKey
App key of the Kony application.
appSecret
App secret of the Kony application.
serviceUrl
URL of the Kony server.
Returns Service doc in the form of a JObject.
System.Exception
The Init method throws this exception when an error occurs while fetching the data or instantiating a service.
Synchronous
//Sample code to initialize Kony Fabric Client synchronously. string appkey = < your - app - key > string appsecret = < your - app - secret > string serviceURL = < your - service - url > Kony.SDK sdkObject = new Kony.sdk(); try { JObject serviceDoc = sdkObject.Init(appkey, appsecret, serviceURL); Console.WriteLine("Init Success"); } catch (Exception e) { Console.WriteLine("Init Failure"); }
Asynchronous
//Sample code to initialize Kony Fabric Client asynchronously. string appkey = < your - app - key > string appsecret = < your - app - secret > string serviceURL = < your - service - url > Kony.SDK sdkObject = new Kony.sdk(); try { JObject serviceObj = await sdkObject.InitAsync(appkey, appsecret, serviceURL); Console.WriteLine("Init Success"); } catch (Exception e) { Console.WriteLine("Init Failure"); }
Copyright © 2020 Kony, Inc. All rights reserved. |