Add more support for apps management: receive callback for state changes.