public final class KitConfig extends Object
ProximityKitManager
to determine how to sync with the cloud server
and transmit usage statistics.ProximityKitManager
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_UNSUPPORTED_GOOGLE_PLAY
Flag allowing an unsupported version of Google Play to be used.
|
static String |
CONFIG_ANALYTICS_URL
URL to app specific kit endpoint on the analytics server.
|
static String |
CONFIG_API_TOKEN
Required. App secret API token used to authenticated with Proximity Kit.
|
static String |
CONFIG_API_URL
Required. URL to app specific kit endpoint on the Proximity Kit server.
|
static String |
CONFIG_CELLULAR_DATA
Flag allowing the use of cellular connections for data sync and usage statistics uploads.
|
static String |
CONFIG_PARTNER_ID
The partner identifier string for analytics.
|
static String |
CONFIG_SYNC_INTERVAL
Length of time, in milliseconds, between syncs with the Proximity Kit server.
|
static long |
DEFAULT_SYNC_INTERVAL
Default sync interval in milliseconds.
|
static long |
MIN_SYNC_INTERVAL
Minimum sync interval in milliseconds.
|
static List |
REQUIRED_KEYS
Immutable list of configuration keys required to be set.
|
Constructor and Description |
---|
KitConfig(Map config)
Create a Proximity Kit configuration using the provided
Map . |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsCellularData()
Lookup if usage of cellular data is allowed for network communications.
|
boolean |
allowsUnsupportedGooglePlay()
Lookup if geofences are allowed to use an unsupported version of Google Play.
|
String |
getAnalyticsURL()
Lookup the analytics url registered for the Proximity Kit.
|
String |
getApiToken()
Lookup the registered Proximity Kit API token.
|
String |
getApiUrl()
Lookup the registered Proximity Kit API resource URL.
|
String |
getKitId()
The Proximity Kit identifier extracted from the API resource URL.
|
String |
getPartnerId()
Lookup the partner identifier used for grouping usage statistics.
|
long |
getSyncInterval()
Lookup the cloud server data sync interval in milliseconds.
|
boolean |
isCellularDataAllowed()
Lookup if usage of cellular data is allowed for network communications.
|
boolean |
isUnsupportedGooglePlayAllowed()
Lookup if geofences are allowed to use an unsupported version of Google Play.
|
public static final String CONFIG_ANALYTICS_URL
public static final String CONFIG_API_TOKEN
public static final String CONFIG_API_URL
public static final String CONFIG_CELLULAR_DATA
true
. Note: both null
and the empty string are
consider absence of values, resulting in this being set to true
. Any other value is
considered false.public static final String CONFIG_PARTNER_ID
null
.public static final String CONFIG_SYNC_INTERVAL
null
, or is the empty string then
the default value is used.public static final long DEFAULT_SYNC_INTERVAL
public static final long MIN_SYNC_INTERVAL
public static final String ALLOW_UNSUPPORTED_GOOGLE_PLAY
false
.public static final List REQUIRED_KEYS
public KitConfig(Map config)
Map
.
The provided config
must contain values for all required keys
. Any additional keys are optional. For any optional key omitted from the map
the documented default values will be used.config
- Settings for connecting with a Proximity Kit. Keys are accessed via the above CONFIG_*
constants. Values, except for null
,
are converted to strings using String.valueOf(Object)
.MissingKeyException
- If config
does not contain one or more required keys
.MissingValueException
- If config
contains null
or an empty string for a required key
value.NullPointerException
- If config
is null
.NumberFormatException
- If the value set for KitConfig.CONFIG_SYNC_INTERVAL
cannot be parsed into a long
.public boolean allowsCellularData()
true
.true
if cellular data connections are allowed for network communication;
false
otherwise.KitConfig.isCellularDataAllowed()
public boolean allowsUnsupportedGooglePlay()
false
.true
if unsupported Google Play versions are allowed; false
otherwise.KitConfig.isUnsupportedGooglePlayAllowed()
public String getAnalyticsURL()
null
or an empty string.public String getApiToken()
null
or an empty string.KitConfig.getApiUrl()
public String getApiUrl()
null
or an empty string.KitConfig.getApiToken()
public String getKitId()
null
or an empty string if the API resource URL was malformed.KitConfig.getApiUrl()
public String getPartnerId()
null
if no
identifier was registered.public long getSyncInterval()
public boolean isCellularDataAllowed()
true
. This is an alias for KitConfig.allowsCellularData()
to work with
beans / common reflection rules.true
if cellular data connections are allowed for network communication;
false
otherwise.KitConfig.allowsCellularData()
public boolean isUnsupportedGooglePlayAllowed()
false
.true
if unsupported Google Play versions are allowed; false
otherwise.KitConfig.allowsUnsupportedGooglePlay()