Add a listener object to listen for lifecycle events.

        :param on_lifecycle_change: (Function), function to be called when LifeCycle state is changed.
        :return: (str), id of the listener.

def add_listener(self, on_lifecycle_change):
        """
        Add a listener object to listen for lifecycle events.

        :param on_lifecycle_change: (Function), function to be called when LifeCycle state is changed.
        :return: (str), id of the listener.
        """
        id = str(uuid.uuid4())
        self._listeners[id] = on_lifecycle_change
        return id