.. index:: 
  !FaceLicense.checkLicense Method
  
.. _id3_face_face_license_check_license_class_method:

===============================================================================
FaceLicense.checkLicense Method
===============================================================================

Module: :ref:`FaceLicense<id3_face_face_license_class>`

Definition
----------

Checks a license from a file.

This function does two things:

- First it loads the license from a file using the given path

- Then it checks the validity of the license regarding the host it is called on (Windows, Linux, Android ...)

.. important:: Calling this function is required to get access to the license member getters.

.. note:: The optional parameter is required on Android and must be the JNIEnv* pointer casted as a void*. It can be set as NULL for other devices.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        @staticmethod
        check_license(license_path: str) -> None

      **Parameters**

        .. line-block::

          ``license_path`` str
          :guilabel:`in` Absolute or relative path to the license file.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        static void checkLicense(String? licensePath)

      **Parameters**

        .. line-block::

          ``licensePath`` String
          :guilabel:`in` Absolute or relative path to the license file.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public static void CheckLicense(string licensePath)

      **Parameters**

        .. line-block::

          ``licensePath`` string
          :guilabel:`in` Absolute or relative path to the license file.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public static void checkLicense(String licensePath) throws FaceException

      **Parameters**

        .. line-block::

          ``licensePath`` String
          :guilabel:`in` Absolute or relative path to the license file.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public static func checkLicense(licensePath: String) throws

      **Parameters**

        .. line-block::

          ``licensePath`` String
          :guilabel:`in` Absolute or relative path to the license file.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3FaceLicense_CheckLicense (
            const char * licensePath, 
            void * optionalParameter)

      **Parameters**

        .. line-block::

          ``licensePath`` const char *
          :guilabel:`in` Absolute or relative path to the license file.

          ``optionalParameter`` void *
          :guilabel:`in` Only used on Android: JNIEnv* pointer casted as a void*. Ignored for other devices.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


