Hello all, I am currently trying to use documentation from Amazon Alexa website on location services to get GPS coordinates from a users phone to give them weather info based on longitude and latitude.
However, I am not sure if I am storing the returned data correctly since I can’t test the custom code. Should there be a better way to store variables from custom code or do you just configure it and hope that it returns the response data you are looking for?
I will attach images to better show you as I am improving my technical communication skills.
As you can see, I am trying to store longitude and latitude from the custom code, but I have no idea if I even wrote the response names correctly to be stored. I will test out on my end, but I wanted to put this here in case anyone else has gotten location services for user phone to work.
you seem to try to access “context” object which is included in Alexa’s response, but you cannot get Alexa’s raw and whole response directly in Voiceflow.
Instead ot that, if users grant permissions to access location data, user info block returns location data like this. In this example, I put its response into a variable “location”.
So I just call the variable like {location}.coordinate.latitudeInDegrees or do I just write it out in custom code like location.coordinate.latitudeInDegrees
I’m trying to see how I can put it into a variable.
I’m going to try and use set blocks to set variables called longitude and latitude to be equal to a users lon and lat values from the user info block
Should this work, just set the longitude and latitude to the variable names I used (I used user_location as the variable name) instead of just location and did .coordinate.LongitudeInDegrees
Hello,
Is there somewhere a complete example, step by step to use location service with Alexa ?
Every search I make bring me back to this topic, so i’m lost.
thank’s by advance for your help