Alexa - getViewportProfile

amazon-alexa

#1

Saw that there’s an Alexa function called getViewportProfile:

https://developer.amazon.com/docs/alexa-presentation-language/apl-viewport-characteristics.html#access-the-viewport-information-in-your-code

I was wondering if this was supported by Jovo


#2

Not exactly the same, but similar.

this.$alexaSkill.getDeviceName()

Returns one of those…

export enum AlexaDeviceName {
    ALEXA_AUDIO_ONLY = 'AUDIO_ALEXA_AUDIO_ONLY',
    ALEXA_HUB_SMALL_ROUND = 'ALEXA_HUB_SMALL_ROUND',
    ALEXA_HUB_SMALL_RECTANGLE = 'ALEXA_HUB_SMALL_RECTANGLE',
    ALEXA_HUB_MEDIUM_RECTANGLE = 'ALEXA_HUB_MEDIUM_RECTANGLE',
    ALEXA_HUB_LARGE_RECTANGLE = 'ALEXA_HUB_LARGE_RECTANGLE',
    ALEXA_TV_XLARGE_RECTANGLE = 'ALEXA_TV_XLARGE_RECTANGLE',
    ALEXA_UNSPECIFIED = 'ALEXA_UNSPECIFIED',
    ALEXA_UNSPECIFIED_SCREEN = 'ALEXA_UNSPECIFIED_SCREEN'
}

#3

Ah that works! Does the same call work for google actions?


#4

Yes, it works with Google Actions, too.

export enum GoogleAssistantDeviceName {
    GOOGLE_ASSISTANT_SPEAKER = 'GOOGLE_ASSISTANT_SPEAKER',
    GOOGLE_ASSISTANT_PHONE = 'GOOGLE_ASSISTANT_PHONE',
    GOOGLE_ASSISTANT_SMARTDISPLAY = 'GOOGLE_ASSISTANT_SMARTDISPLAY',
}

#5

It doesn’t seem like this.$googleAction.getDeviceName() is working (Cloudwatch is saying this.$googleAction.getDeviceName is not a function. Is it named something else?


#6

Oops. my bad.

It’s this.$request,getDeviceName() for both platforms.