question

Jean Vence avatar image
Jean Vence asked ·

PermissionAcceptedRequest handler in Java

I'm developing a skill using java ASK sdk v2 and would like to add a PermissionAcceptedRequest handler. I've created a handler that has the following function:


    @Override
    public boolean canHandle(HandlerInput input, IntentRequest intentRequest)
        return input.matches(requestType(PermissionAcceptedRequest.class)
    }

But the handler is never called. I think I need to create a skill manifest and register to receive these events per https://developer.amazon.com/docs/smapi/skill-manifest.html

Does anyone shed more light on how can this be done without using CLI? Any examples would be very helpful.

Thanks,

Jean

apljava
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anand@Amazon avatar image
Anand@Amazon answered ·

Hey @Jean Vence

Thanks for raising your issue here !!

Yes, your skill manifest must include an events object which includes your subscriptions to events.

Ex :

subscriptions:[
                    {
                        eventName: 'SKILL_PERMISSION_ACCEPTED'
                    },
                    {
                        eventName: 'SKILL_PERMISSION_CHANGED'
                    }
        ]

And then in your handler check for "AlexaSkillEvent.SkillPermissionAccepted" or "AlexaSkillEvent.SkilPermissionChanged" request type and perform action accordingly.

Check here for more details.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jean Vence avatar image
Jean Vence answered ·

Thanks @Anand@Amazon - How do I create a manifest file if I'm NOT using ASK CLI?

1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hey @Jean Vence

Currently these types of skills can only be developed using ASK CLI or SMAPI but not from developer portal.

Check here to learn more about how to get started with ASK CLI.

0 Likes 0 ·