Added on message code

Added on message code, based on the echobot sample shared.