updated for supporting message on ios.