The 'Network Policy API ' helps a developer to enable or disable Network from within an app.
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.
JavaScript:com.kony.iemm.app.setNetworkPolicy(isNwAllowed,NwDomain,forceHTTPS,isAllowWifi,ssid);
| 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 |
Int
| 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) |
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.
JavaScript:com.kony.iemm.app.clearNetworkPolicy();
Int
| 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. |