I’m using this piece of code try {
console.log(“REMINDERS GET”);
const result = await this.$alexaSkill.$user.getAllReminders();
console.log("reminders = "+ result);
} catch(error) {
if (error.code === ‘NO_USER_PERMISSION’) {
this.tell(Please grant the permission to set reminders.
);
} else {
console.error('ERROR = ’ +error);
console.error('Error.code = ’ + error.code);
// Do something
}
}
even if no permission from user side error.code will never be 'NO_USER_PERMISSION
here log :
12:07:27
2020-05-06T12:07:27.481Z b220d3fb-d219-46a8-b5fa-60cc601ce699 INFO REMINDERS GET
2020-05-06T12:07:27.481Z b220d3fb-d219-46a8-b5fa-60cc601ce699 INFO REMINDERS GET
12:07:27
2020-05-06T12:07:27.681Z b220d3fb-d219-46a8-b5fa-60cc601ce699 ERROR ERROR = Error: Something went wrong.
2020-05-06T12:07:27.681Z b220d3fb-d219-46a8-b5fa-60cc601ce699 ERROR ERROR = Error: Something went wrong.
12:07:27
2020-05-06T12:07:27.681Z b220d3fb-d219-46a8-b5fa-60cc601ce699 ERROR Error.code = ERROR
2020-05-06T12:07:27.681Z b220d3fb-d219-46a8-b5fa-60cc601ce699 ERROR Error.code = ERROR
And please: how I can ask to user (when if statement will work) to give permission?
There is something like
this.$alexaSkill.showAskForListPermissionCard([‘read’]) .tell(‘Please grant the permission to access your lists.’);
even for reminders?