Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the sample code to send Proactive Event #13

Closed
brijeshkundu opened this issue Oct 23, 2022 · 2 comments
Closed

Error in the sample code to send Proactive Event #13

brijeshkundu opened this issue Oct 23, 2022 · 2 comments

Comments

@brijeshkundu
Copy link

Thank you so much for your project. It's great. I am trying to use your project to send Alexa proactive event message. The sample code you have given is giving me an error on line -

event.getEvent().getPayload().getMessageGroup().getCreator().setName("Test");

Error by eclipse - Multiple markers at this line

  • Syntax error on token "getEvent", Identifier expected after this token
  • Syntax error on token ".", { expected

Below is what I am using from your example:
AlexaProactiveEventSenderClient client = new AlexaProactiveEventSenderClient(clientId, secretId);
ProactiveEvent event = new ProactiveEvent();
event.getEvent().getPayload().getMessageGroup().getCreator().setName("Test");
URLRegion urlRegion = new URLRegion();
urlRegion.setRegion(Region.NA);
urlRegion.setEnvironment(Environment.DEV);
client.sendProactiveEvent(event, urlRegion);

@brijeshkundu
Copy link
Author

I found the issue. The above code mentioned in the example should be put inside a static method. Something like- pubic static void main. Then it will work.

@xavidop
Copy link
Owner

xavidop commented Oct 27, 2022

hi @brijeshkundu can you please create a PR with the fix?

@xavidop xavidop closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants