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

GeoFence Policy API

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

com.kony.iemm.app.setGeoFencePolicy

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

Signature

JavaScript:com.kony.iemm.app.setGeoFencePolicy(allow,regions);

Input Parameters

Variable Name allow
Presence Mandatory
Type Boolean
Values True - app usage is allowed in specified regions only
False - app usage is restricted in specified regions only

 

Variable Name regions
Presence Mandatory
Type String Array
Values Set of geo-fences defined by (lat:long:radius) in string array

 

Result Values

Int

Result Codes

Code Description
100 INVALID_DATA
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.clearGeoFencePolicy

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

Signature

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

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.