Coder Social home page Coder Social logo

maxbeckers / amazon-alexa-bundle Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 2.0 20 KB

Symfony Bundle for amazon alexa skills.

License: MIT License

PHP 100.00%
symfony-bundle alexa amazon-alexa-skill amazon-alexa-bundle composer amazon-echo alexa-skills-kit alexa-skill echo-api alexa-sdk

amazon-alexa-bundle's Introduction

amazon-alexa-bundle's People

Contributors

maxbeckers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fabeat tacman

amazon-alexa-bundle's Issues

Update documentation for modern Symfony

Symfony no longer supports getting a service with ->get(). Instead, it requires injecting the service in the constructor.

Also, a demo repo for this bundle would be great, especially if it included the documentation for how to do the setup on the Amazon side.

Thanks!

Laravel version ?

Hi
sorry if the question is stupid, but is it work with laravel ?

500 Error

Hi. Thanks for your work.

I have problems with my endpoints. I've installed the bundle and trying to configure handlers:

/app/config/routes/maxbeckers_amazon_alexa.yaml

maxbeckers_amazon_alexa:
  path: /alexa/
  defaults: { _controller: MaxBeckersAmazonAlexaBundle:AmazonAlexa:amazonRequest }

Here is my app/config/services.yaml file:

... 

alexa.launch_request.handler:
        class: App\Intents\LaunchRequest\LaunchRequestHandler
        arguments:
            - '@maxbeckers_amazon_alexa.response_helper' # ResponseHelper
        tags:
            - 'maxbeckers_amazon_alexa.request_handler'

And my request handler:

<?php

declare(strict_types=1);

namespace App\Intents\LaunchRequest;

use MaxBeckers\AmazonAlexa\Helper\ResponseHelper;
use MaxBeckers\AmazonAlexa\Request\Request;
use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler;
use MaxBeckers\AmazonAlexa\Response\Response;

class LaunchRequestHandler extends AbstractRequestHandler
{
    /**
     * @var ResponseHelper
     */
    private ResponseHelper $responseHelper;

    /**
     * @param ResponseHelper $responseHelper
     */
    public function __construct(ResponseHelper $responseHelper)
    {
        $this->responseHelper          = $responseHelper;
        $this->supportedApplicationIds = ['my-id'];
    }

    /**
     * @param Request $request
     * @return bool
     */
    public function supportsRequest(Request $request): bool
    {
        return $request->request instanceof Request\Standard\LaunchRequest;
    }

    /**
     * @param Request $request
     * @return Response|null
     */
    public function handleRequest(Request $request): ?Response
    {
        return $this->responseHelper->respond('Success :)');
    }
}

I'm testing the app with amazon developer console, and get an error:

SKILL_ENDPOINT_ERROR: Skill returned with a non-ok status [500, Internal Server Error] and another ones like this..

Bildschirmfoto 2020-09-19 um 19 32 46

What am I doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.