jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.68k stars 309 forks source link

Alexa Lists in v4 #1251

Closed NLueg closed 2 years ago

NLueg commented 2 years ago

I'm submitting a...

Expected Behavior

It should be documented how to ask for permissions to lists and how to add items to the users list. I actually found a quite old fork where it's documented: https://github.com/gwythyr/jovo-framework-nodejs/blob/master/docs/05_platform-specifics/amazon-alexa/lists.md

Current Behavior

I have no idea how to include the users list. I don't found any documentation about this.

Your Environment

jankoenig commented 2 years ago

We don't have convenience classes for this yet, but the permission cards could be added to the response using the nativeResponse property.

It might also be helpful to look at the reminders documentation, because the implementation would probably look similar: https://www.jovo.tech/marketplace/platform-alexa/reminders#permissions-consent-card

Happy to take a look at a PR if anyone from the community wants to build this

NLueg commented 2 years ago

@jankoenig Thank you for your answer. I will try to implement this by myself and will create a PR for this. I currently struggle with the Events that Alexa can send to a skill. Not sure, if this is a new issue, but for now I will leave it in a comment.

In Jovo v3 there was an ON_EVENT handler (for example like here: https://github.com/jovotech/jovo-templates/blob/7939c654191bc961ecec9b91eac27c29295043e5/alexa/skillevents/typescript/src/app.ts) I don't found any similar concept for Jovo v4.

aswetlow commented 2 years ago

Hey @NLueg

The @Handle decorator is a powerful tool for these use cases. https://www.jovo.tech/docs/handle-decorators

@Handle({
  global: true,
  types: ['AlexaSkillEvent.SkillDisabled'],
  platforms: ['alexa'],
})
handleSkillDisabledEvent() {
  // 
}
NLueg commented 2 years ago

Ah, okay perfect. I actually looked into the docs, but I think I'm blind 😄 Thank you very much for the fast response!

NLueg commented 2 years ago

I actually managed it to implement the functionality in Jovo v4. Besides the new Handlers I oriented myself heavily on the reminder implementation of the framework. With this and the documentation of the Alexa-REST-API it was quite simple.

Thanks again!

jankoenig commented 2 years ago

Nice @NLueg! Would you be interested in adding this as a PR? That would be amazing

Here's more information: https://www.jovo.tech/docs/contributing#pr-workflow

NLueg commented 2 years ago

@jankoenig sure! Would love to create a PR for this. You mean for the new API or an example with the required handlers? Or both? 😄

jankoenig commented 2 years ago

Great! Whatever you think is helpful for the community, hehe.

Happy to assist if you run into any issues. Thanks!

NLueg commented 2 years ago

Can be closed as #1418 was merged 🙂