Difference between KNYMobileFabric and kony.sdk.getCurrentInstance()

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

There is no IntelliSense neither documentation regarding those two objects (string search in the documentation and googling as well). I can see that kony.sdk.getCurrentInstance(); from the JS SDK source code is invoked currentInstance which is assigned to {this}. {This} as we know may vary.

When I alert those two objects I got the same properties. I think that there are some different ones as well in KNYMobileFabric. They both work and I can use method getIntegrationService on both to get konfigured in Kony Fabric integration service.

May I know the difference?

PS: I believe that this question will be very useful to the community since there is lack of info about this topic.

@Anisv Zimmewmvn Both KNYMobileFabric and kony.sdk.getCurrentInstance() would return you a same response if you are using AutoInit(linking the MF app to Visualizer project as mentioned here http://docs.kony.com/konylibrary/konyfabric/kony_fabric_user_guide/Default.htm#KonyStudio/Installing_KonyJS_SDK.htm#InitialiJS%3FTocPath%3DSDKs%7CKony%2520Visualizer%7C_____5 refer Kony Fabric Client SDK)

If you additionally call SDK init from the application and assign this to any object then that object will hold the current instance instead of the object KNYMobileFabric(if init call is made to other MF app instead of linked app from Visualizer).

Check if SDK init has been called in the application.

Thanks for clarifying that fact : )

How can I get different response from as you said - the same object (KNYMobileFabric) and (kony.sdk.getIntegrationService) ?

var fabric = kony.sdk.getCurrentInstance(); var serviceName = "MySqlIConnection";

var service = fabric.getIntegrationService(serviceName);

Is producing error message: “Invalid service name”

var serviceName = “MySqlIConnection”;

var service = KNYMobileFabric.getIntegrationService(serviceName);

Is producing error message: “Please call login in Identity Service before invoking this service”

@Anne Ross​ ?

Hi @Anisv Zimmewmvn​ ,

To help you better, Let us know below details.

  1. Are you trying to use Kony Fabric by linking a Fabric application through Kony Visualizer Enterprise and building your Visualizer application against runtime where your services are published? If yes, Please attach your startup.js file from <workspace>/<project_name>/jssrc/<platform_name>/startup/startup.js. (You can replace any sensitive details from the file if you want to).
  2. Are you trying to initialise SDK by custom code in Javascript modules? if yes, please attach the module where you are initialising SDK.
  3. You Kony Visualizer Enterprise and Kony Fabric versions ?

Invalid service name might come when you are initialising SDK Object with wrong service Document as part of Auto-init of Visualizer. We will need more information to deduce the root cause.

Coming to the part of difference between KNYMobileFabric and kony.sdk.getIntegrationService(), I don;'t think there should be any?

@Adwivn Edmunds​ @Isvvc Cvmewon​ Can you confirm the same?