Unable to get country and postal code using the following :
try {
const countryAndPostalCode = await this.$alexaSkill.$user.getCountryAndPostalCode();
countryCode = countryAndPostalCode.countryCode;
console.log(countryAndPostalCode);
console.log(countryCode);
}
catch(error) {
if (error.code === 'NO_USER_PERMISSION') {
this.$alexaSkill.showAskForCountryAndPostalCodeCard()
.tell(`Please grant access to your Country and Postal Code in the Alexa app.`);
}
else {
// console.log(error.code);
return this.tell('Something is wrong with me, please contact the manager');
}
}
I have set the relevant permissions in skill.json and also given proper permission to the skill while using it.
The console.log statements in the try block above prints :
{}
undefined
I need urgent help with this.