Class MPApiKeyValidatorService


  • public class MPApiKeyValidatorService
    extends java.lang.Object
    Makes a request to one of our sync endpoints looking for an MIError.INVALID_API_KEY error
    • Field Detail

      • REGEXP_PATTERN_SOLUTION_ALIAS_VALIDITY

        @NonNull
        public static final java.util.regex.Pattern REGEXP_PATTERN_SOLUTION_ALIAS_VALIDITY
    • Constructor Detail

      • MPApiKeyValidatorService

        public MPApiKeyValidatorService()
    • Method Detail

      • checkAPIKeyValidity

        public static void checkAPIKeyValidity​(@NonNull
                                               OnResultReadyListener listener)
        Checks if the currently set API Key set is still a valid one

        Note 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 on
        listener - 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 one

        Note that the SDK doesn't need to be initialized in order to call this method

        Possible callback error values:

        Parameters:
        apiKey - A MapsIndoors API Key
        listener - 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 one

        The 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