Alexa Voice Service (AVS) is a huge thing for IoT devices, especially when paired with wake word detection engine. But I have not found any decent implementation on iOS with Swift 3 yet, so I went ahead and implemented one.
It is available on the GitHub.
The app is seen as one of my Alexa “devices”, which means it is associated with my Amazon account. Therefore, it knows who I am when I asked: “who am I?”. I also implemented Timer, which uses a concept called Downchannel. It is interesting that the timer/alarm is set up on the client side, and triggered on the client side, while the server side basically maintains the state (which requires client to provide).
Unlike any AWS services, AVS has no SDK besides some online documentations & API endpoints. There are not enough example code either. As a developer, I have to write almost everything, including construct HTTPS request header and parse JSON & audio responses 😦