Reputation: 2265
I'm working on my coming soon music player skill. I'd like to have different behaviour following a different skil linvocation, by example:
1. start immediately the audio streaming:
Play MyMusicSkillName
2. just introduce the skill behaviour with a welcome/help message:
Open MyMusicSkillName
My question is: There is a way to distinguish the invocation VERB, getting the invocation starting phrase (and distinguish in LaunchRequest event)? Any idea?
See documentation: https://developer.amazon.com/docs/custom-skills/understanding-how-users-invoke-custom-skills.html#invoking-a-skill-with-no-specific-request-no-intent
Ask Alexa, Ask Daily Horoscopes
Begin Alexa, Begin Trivia Master
Launch Alexa, Launch Car Fu
Load Alexa, Load Daily Horoscopes
Open Alexa, Open Daily Horoscopes
Play Alexa, Play Trivia Master
Play the game Alexa, Play the game Trivia Master
Resume Alexa, Resume Trivia Master
Run Alexa, Run Daily Horoscopes
Start Alexa, Start Daily Horoscopes
Start playing the game Alexa, Start playing the game Trivia Master
Tell Alexa, Tell Daily Horoscopes
Use Alexa, Use Daily Horoscopes
Upvotes: 1
Views: 1024
Reputation: 3287
Unfortunately, the LaunchRequest
does not provide any way to differentiate how the user opened your skill.
However, you can differentiate between a new user and a user who has used the skill before by saving something in your database such as a last_played
audio. Then when you handle the LaunchRequest
, you can check that user's ID in your database and if they have a last_played
entry, then automatically continue playing. Or if its a new user, then provide an introduction/welcome message.
Returning users who you think want to hear the introduction message by saying "Open" instead of "Play" probably want to be reminded of what to do or what options the skill has, which you should handle in the HelpIntent
anyway. So if your skill auto played for them, they should naturally ask a question of your skill that will launch the HelpIntent
.
Upvotes: 3