This namespace provides access to the APN functionality.
- Since:
Classes
Members
-
static, readonly ApnStatusCode :object
-
This enumeration represents an error status code of mobicontrol.apn.ApnError.
Properties:
Name Type Description UNKNOWNobject The exact error could not be determined. NOT_SUPPORTEDobject APN configuration is not supported on this device. OPERATION_NOT_SUPPORTEDobject Specific APN operation is not supported on this device. PROPERTY_NOT_SUPPORTEDobject Specific APN property is not supported on this device. - Since:
-
static, readonly MvnoType :object
-
This enumeration represents the MVNO type of mobicontrol.apn.ApnConfiguration and mobicontrol.apn.Apn.
Properties:
Name Type Description NONEobject APN configuration is not restricted to use on a particular MVNO or a subscriber account. SPNobject The value to match is an SPN value (Service Provider Name). IMSIobject The value to match is an IMSI value (International Mobile Subscriber Identity). GIDobject The value to match is a Group Identifer Level 1. - Since:
Methods
-
static createApnConfiguration(apn, mcc, mnc) → {mobicontrol.apn.ApnConfiguration}
-
Create APN configuration.
Parameters:
Name Type Description apnstring Access point name, must not be empty. mccstring Mobile country code, must consist of three decimal digits. mncstring Mobile network code, must consist of two or three decimal digits. Returns:
mobicontrol.apn.ApnConfiguration - APN configuration.- Since:
Example
const CANADA_MCC = '302'; const ROGERS_MNC = '720'; var config = mobicontrol.apn.createApnConfiguration('ltemobile.apn', CANADA_MCC, ROGERS_MNC); mobicontrol.log.info(config.apn + ',' + config.mcc + ',' + config.mnc); -
static getPreferred() → nullable {mobicontrol.apn.Apn}
-
Get preferred APN.
Throws:
- Since:
Example
var apn = mobicontrol.apn.getPreferred(); if (apn != null && apn.mcc == '302') { mobicontrol.log.info("Preferred APN is Canadian."); } -
static install(config) → {mobicontrol.apn.Apn}
-
Install APN configuration.
Parameters:
Name Type Description configmobicontrol.apn.ApnConfiguration APN configuration Throws:
Returns:
mobicontrol.apn.Apn - Installed APN- Since:
Example
var config = mobicontrol.apn.createApnConfiguration('ltemobile.apn', '302', '720'); mobicontrol.apn.install(config); -
static listApns() → {Array.<mobicontrol.apn.Apn>}
-
List installed APNs. Note: Android phones come pre-installed with a large database of APN configurations for many different carriers around the world. In order to get APNs available for only the current network operator, use mobicontrol.apn.listCurrentOperatorApns.
Throws:
Returns:
Array.<mobicontrol.apn.Apn> - An array of installed APNs.- Since:
Example
var apn = mobicontrol.apn.listApns().find(apn => apn.apn === 'ltemobile.apn'); if (apn != null) { mobicontrol.apn.setPreferred(apn); mobicontrol.log.info("Preferred APN is set to ltemobile.apn."); } -
static listCurrentOperatorApns() → {Array.<mobicontrol.apn.Apn>}
-
List installed APNs filtered by the current operator.
Throws:
Returns:
Array.<mobicontrol.apn.Apn> - An array of installed APNs filtered by the current operator.- Since:
-
static setPreferred(apn)
-
Set installed APN as preferred.
Parameters:
Name Type Description apnmobicontrol.apn.Apn Installed APN Throws:
- Since:
Example
var config = mobicontrol.apn.createApnConfiguration('ltemobile.apn', '302', '720'); var apn = mobicontrol.apn.install(config); mobicontrol.apn.setPreferred(apn); -
static uninstall(apn)
-
Uninstall APN.
Parameters:
Name Type Description apnmobicontrol.apn.Apn Installed APN Throws:
- Since:
Example
const ROGERS_MNC = '720'; mobicontrol.apn.listApns().forEach( apn => { if (apn.mnc == ROGERS_MNC) { mobicontrol.apn.uninstall(apn); } } ); mobicontrol.log.info("All Rogers APNs are uninstalled.");