To be compliant you need to ask permission to send SMS messages. MobileMonkey makes this easy with this widget. You place this in your dialogue and it will opt users in or not based on their answer. As you can see in the image below it's a Yes or No answer. If they answer Yes then they are subscribed and if they say no then they won't.