Alexa Reminder error problem

amazon-alexa

#1

I’m using this piece of code :slight_smile: 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?


#2

Hey @Gianfranco_Maffei

Sorry for the late response. I looked into it and found a bug which is fixed now. Please run jovo update

You can use voice permissions to let Alexa ask the user for reminder permissions without going to the app.

this.$alexaSkill.askForReminders();
this.ask('Would you like to be reminded?');
ON_PERMISSION() {
		const status = this.$alexaSkill.getPermissionStatus();
		if (this.$alexaSkill.hasPermissionAccepted()) {
			// do stuff
		}

		this.tell(status);
	},