Hello guys, welcome to the 29th session of create custom Alexa skill using AWS lambda function tutorial for beginners. In this session we will have one device. Note that using Alexa we cannot obtain the address of device itself via GP. It will often address that entered by the user and Alex our app or website. We need to add permissions for address agreed. For this, I'm going to use second demo skills that he has created.
That is created during 10 for that with name show address to the user may say to my address on what is my interest beta model. As we proceed, we need to enable permission for the address. For this click on conditions Enable device address. There are two options, we can obtain a full address or the country or PIN code. There is no different lender from here we need to set default API clients call this API client method and pass new default API client. Create a new intern for sure.
Obtained request and the love and service client factory from handler input and we also need to obtain consent to confirming this formation if we don't have tokens means the user does not provide permissions for your scheme. In that situation we need to ask the user to provide permission. For that, use wait ask for permissions consent can matter. It will take an array of permissions that are required. Here we can ask for address rate. Please treat this right, or even Amazon pays permission.
But here we only require device address read permissions, so passive Yeah, if the user gives permission then create a try catch block. In catch written message that an error occurred to retry the address. In try block obtain the device ID obtained device address service client from service client factory called get full address method and pass device ID This method is acing. So we need to write a weight here and a sink in handle function definition. Initially, address text will be not from your address you think got the address. Then change address text to your addresses address line one state or region and postal code.
Here I am returning it but you can also store in a database are called third party ca Access handler in request in the file and deploy lambda function. Alexa, open the second demo. Welcome to your first Alexa skill from version two SDK. show my address provide device address permissions. Getting mobile, we got a card for permission, he can manage another device address and save settings. Let's test this again.
Alexa, open the second demo. Welcome to your first Alexa skill from version two SDK. show my address. Your address is my first address line Gujarat 380,061. Here I have got an address that exists in device address setting of my eco doc. Let us see what we are learning this session.
Using address EPA we can obtain an address that's added by user not physical address via GP. We need to use appropriate permission sets for data that we are required. And we are also set default APA flag for skill building. First of all, we obtain consent token Don't have them use breach ask for permission consent card method to obtain information. Otherwise, use get full address method of device address service and generate a simple response. Thanks for watching this video.
If you have any doubts, please feel free to contact me nicely