Kony Management API Guide: App Management EMM JS APIs > Network Policy API

Network Policy API

The 'Network Policy API ' helps a developer to enable or disable Network from within an app.

com.kony.iemm.app.setNetworkPolicy

This method sets Network policy defined by a developer to an app. This will overwrite Network policy if that is already set from the server.

Signature

JavaScript:com.kony.iemm.app.setNetworkPolicy(isNwAllowed,NwDomain,forceHTTPS,isAllowWifi,ssid);

Input Parameters

Variable Name isNwAllowed
Presence Mandatory
Type Boolean
Values True - network usage is allowed
False - network usage is not allowed

 

Variable Name NwDomain
Presence Mandatory
Type String Array
Values Set of network domains in string array

 

Variable Name forceHTTPS
Presence Mandatory
Type Boolean
Values True - Establish secure http connection(https)
False - https not required

 

Variable Name isAllowWifi
Presence Mandatory
Type Boolean
Values True - network communication is allowed for mentioned/provided WiFi SSID
False - network communication is not allowed in mentioned/provided WiFi SSID

 

Variable Name ssid
Presence Mandatory
Type Array
Values Set of ssid in string array

 

Result Values

Int

Result Codes

Code Description
200 SUCCESS
300 NULL_OR_EMPTY_DATA
400 FEATURE_NOT_SUPPORTED
500 FAILURE
600

APP_CONTEXT_NULL_ERRORCODE (android)

700 PACKAGE_NULL_ERRORCODE(android)

com.kony.iemm.app.clearNetworkPolicy

This method clears Network policy set by a developer. Once developer defined policy is cleared, the server defined Network policy will be applied to an app if any.

Signature

JavaScript:com.kony.iemm.app.clearNetworkPolicy();

Input Parameters

Result Values

Int

Result Codes

Code Description
200 SUCCESS
500 FAILURE
400 FEATURE_NOT_SUPPORTED
600

APP_CONTEXT_NULL_ERRORCODE (android)

700 PACKAGE_NULL_ERRORCODE(android)
Copyright © 2017 Kony, Inc. All rights reserved.