Package com.mapsindoors.mapssdk
Class MPApiKeyValidatorService
- java.lang.Object
-
- com.mapsindoors.mapssdk.MPApiKeyValidatorService
-
public class MPApiKeyValidatorService extends java.lang.Object
Makes a request to one of our sync endpoints looking for anMIError.INVALID_API_KEY
error
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
REGEXP_PATTERN_SOLUTION_ALIAS_VALIDITY
-
Constructor Summary
Constructors Constructor Description MPApiKeyValidatorService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkAPIKeyValidity(OnResultReadyListener listener)
Checks if the currently set API Key set is still a valid onestatic void
checkAPIKeyValidity(java.lang.String apiKey, OnResultReadyListener listener)
Check if the given MapsIndoors API Key is a valid onestatic void
checkAuthToken(java.lang.String apiKey, OnResultReadyListener listener)
Check if the AuthToken set works for the given API key.static boolean
validateAPIKeyStringFormat(java.lang.String apiKey)
Checks that the given API Key string format is a valid one
-
-
-
Method Detail
-
checkAPIKeyValidity
public static void checkAPIKeyValidity(@NonNull OnResultReadyListener listener)
Checks if the currently set API Key set is still a valid oneNote that this method should only be used if the SDK has been already initialized
- Parameters:
listener
- A mandatory listener
-
checkAuthToken
public static void checkAuthToken(@NonNull java.lang.String apiKey, @NonNull OnResultReadyListener listener)
Check if the AuthToken set works for the given API key.- Parameters:
apiKey
- the api key to check the Authtoken onlistener
- A listener to return the result of the check. Returns error if the auth token is not valid.
-
checkAPIKeyValidity
public static void checkAPIKeyValidity(@NonNull java.lang.String apiKey, @NonNull OnResultReadyListener listener)
Check if the given MapsIndoors API Key is a valid oneNote that the SDK doesn't need to be initialized in order to call this method
Possible callback error values:
null
if the given api key was a valid oneMIError.INVALID_API_KEY
if the given api key doesn't exists or did expire (case of a PoC)MIError.NETWORK_ERROR
if there was any network related issue when this method was invokedMIError.UNKNOWN_ERROR
- Parameters:
apiKey
- A MapsIndoors API Keylistener
- A mandatory listener- Since:
- 3.4.0
-
validateAPIKeyStringFormat
public static boolean validateAPIKeyStringFormat(@Nullable java.lang.String apiKey)
Checks that the given API Key string format is a valid oneThe given API Key must contain only alphanumeric characters
- Parameters:
apiKey
- A MapsIndoors API Key- Returns:
true
if the given string matches the[0-9a-zA-Z]+
regex,false
otherwise- Since:
- 3.4.0
-
-