Alexa.NET.APL
1.2.0
See the version list below for details.
dotnet add package Alexa.NET.APL --version 1.2.0
NuGet\Install-Package Alexa.NET.APL -Version 1.2.0
<PackageReference Include="Alexa.NET.APL" Version="1.2.0" />
paket add Alexa.NET.APL --version 1.2.0
#r "nuget: Alexa.NET.APL, 1.2.0"
// Install Alexa.NET.APL as a Cake Addin #addin nuget:?package=Alexa.NET.APL&version=1.2.0 // Install Alexa.NET.APL as a Cake Tool #tool nuget:?package=Alexa.NET.APL&version=1.2.0
Alexa.NET.APL
Small helper library to allow Alexa.NET skills to work with APL
Access to APL ViewPort Data within your skill
There are new Display
and Viewport
properties available within the request being sent to an APL enabled skill.
Rather than create a forced dependency for Alexa.NET - APL skills have an enhanced SkillRequest object with these new properties
Amazon information on Viewport information: https://developer.amazon.com/docs/alexa-presentation-language/apl-viewport-characteristics.html
Here's an example signature and opening line for a lambda function
public Task<SkillResponse> FunctionHandler(APLSkillRequest input, ILambdaContext context)
var shape = input.Context.Viewport?.Shape;
Creating a Layout Document
Alexa.NET.APL has a set of APL components so that creating layouts is entirely within the C# object model
All properties are of Type APLValue<T>
- which allows you to specify an absolute value or an APL data binding expression for each property
new Layout(new[]
{
new Container(
new APLComponent[]{
new Text("APL in C#"){FontSize = "24dp",TextAlign= "Center"},
new Image("https://example.com/image.jpg"){Width = 400,Height=400}
})
}){Direction = "row"}
})
Sending a RenderDocument Directove
RenderDocument hooks into the same Alexa.NET directive mechanism that already exists, you just reference the layout, document token and any data sources you want to send along with it
var shape = input.Context.Viewport?.Shape;
var response = ResponseBuilder.Tell($"Your viewport is {shape.ToString() ?? "Non existent"}");
var directive = new RenderDocumentDirective
{
Token = "randomToken",
Document = new APLDocument
{
MainTemplate = new Layout(new[]
{
new Container(new APLComponent[]{
new Text("APL in C#"){FontSize = "24dp",TextAlign= "Center"},
new Image("https://images.example.com/photos/2143/lights-party-dancing-music.jpg?cs=srgb&dl=cheerful-club-concert-2143.jpg&fm=jpg"){Width = 400,Height=400}
}){Direction = "row"}
})
}
};
response.Response.Directives.Add(directive);
Receiving SendEvent Commands from your layout
Commands are supported within Alexa.NET.APL - to send events back from your layout to your skill you need the SendEvent Command:
var wrapper = new TouchWrapper
{
OnPress = new SendEvent
{
Arguments = new Dictionary<string, object> {{"sent", true}}
}
};
To receive these events you need to add support for the UserEventRequest, which can be placed in your Lambda constructor
new UserEventRequestHandler().AddToRequestConverter();
and then you treat them like any other request type, for example
if (input.Request is UserEventRequest userEvent)
{
var token = userEvent.Token;
var argument = userEvent.Arguments["sent"];
}
Obviously your user may interact with your skill through voice means, at which point you need to be able to send commands down to your layout. This is done with the ExecuteCommands directive
using Alexa.NET.APL.Commands;
...
var sendEvent = new ExecuteCommandsDirective("token",new []
{
new SetPage
{
ComponentId="exampleId",
Value=3
}
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.6 is compatible. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 1.6
- Alexa.NET (>= 1.5.4)
- NETStandard.Library (>= 1.6.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Alexa.NET.APL:
Package | Downloads |
---|---|
Ask.Sdk.Core
Core SDK package that contains the basic components and default implementations of ASK SDK for .Net Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.4.0 | 1,027 | 4/4/2024 |
8.3.0 | 5,909 | 1/14/2024 |
8.2.0 | 20,921 | 8/24/2023 |
8.1.0 | 3,632 | 5/29/2023 |
8.0.0 | 185 | 5/27/2023 |
7.6.3 | 2,243 | 2/8/2023 |
7.6.2 | 1,855 | 10/22/2022 |
7.6.1 | 805 | 8/15/2022 |
7.6.0 | 4,503 | 6/9/2022 |
7.5.0 | 2,125 | 12/16/2021 |
7.4.0 | 1,396 | 10/1/2021 |
7.3.0 | 1,076 | 7/21/2021 |
7.2.0 | 18,306 | 4/3/2021 |
7.1.0 | 708 | 2/17/2021 |
7.0.0 | 5,558 | 11/20/2020 |
6.1.0 | 1,176 | 9/26/2020 |
6.0.4 | 1,526 | 7/24/2020 |
6.0.3 | 609 | 7/23/2020 |
6.0.2 | 596 | 7/23/2020 |
5.1.1 | 3,250 | 3/31/2020 |
5.1.0 | 571 | 3/26/2020 |
5.0.0 | 600 | 3/26/2020 |
4.9.1 | 551 | 3/17/2020 |
4.9.0 | 811 | 1/6/2020 |
4.8.1 | 586 | 12/19/2019 |
4.8.0 | 609 | 12/5/2019 |
4.7.0 | 670 | 11/26/2019 |
4.6.0 | 956 | 11/7/2019 |
4.5.1 | 626 | 11/1/2019 |
4.4.2 | 604 | 10/30/2019 |
4.4.1 | 595 | 10/30/2019 |
4.4.0 | 599 | 10/25/2019 |
4.3.1 | 560 | 10/24/2019 |
4.3.0 | 584 | 10/24/2019 |
4.2.3 | 666 | 9/10/2019 |
4.2.1 | 581 | 9/10/2019 |
4.2.0 | 2,897 | 8/9/2019 |
4.1.2 | 655 | 8/8/2019 |
4.1.1 | 660 | 8/8/2019 |
4.1.0 | 694 | 8/7/2019 |
4.0.13 | 740 | 7/28/2019 |
4.0.12 | 677 | 7/28/2019 |
4.0.11 | 728 | 7/15/2019 |
4.0.10 | 708 | 7/14/2019 |
4.0.9 | 648 | 7/14/2019 |
4.0.8 | 641 | 7/14/2019 |
4.0.7 | 703 | 7/14/2019 |
4.0.6 | 711 | 7/11/2019 |
4.0.5 | 702 | 7/10/2019 |
4.0.4 | 696 | 7/10/2019 |
4.0.2 | 697 | 7/10/2019 |
4.0.1 | 705 | 7/7/2019 |
4.0.0 | 645 | 7/6/2019 |
3.15.0 | 733 | 5/15/2019 |
3.14.0 | 704 | 5/9/2019 |
3.13.0 | 688 | 5/5/2019 |
3.12.0 | 685 | 5/4/2019 |
3.11.0 | 1,240 | 3/27/2019 |
3.10.0 | 669 | 3/27/2019 |
3.9.0 | 646 | 3/18/2019 |
3.8.0 | 770 | 3/4/2019 |
3.7.0 | 723 | 3/3/2019 |
3.6.3 | 795 | 1/31/2019 |
3.6.2 | 814 | 1/23/2019 |
3.6.1 | 1,398 | 1/14/2019 |
3.5.0 | 819 | 1/14/2019 |
3.4.0 | 845 | 1/9/2019 |
3.3.0 | 783 | 1/9/2019 |
3.1.0 | 818 | 12/26/2018 |
3.0.0 | 748 | 12/25/2018 |
2.1.0 | 765 | 12/25/2018 |
2.0.0 | 895 | 12/13/2018 |
1.6.4 | 797 | 12/7/2018 |
1.6.3 | 1,110 | 11/11/2018 |
1.6.1 | 879 | 11/11/2018 |
1.6.0 | 789 | 11/11/2018 |
1.5.0 | 867 | 11/6/2018 |
1.4.3 | 846 | 11/6/2018 |
1.4.2 | 792 | 11/6/2018 |
1.4.1 | 799 | 11/6/2018 |
1.4.0 | 813 | 11/5/2018 |
1.3.2 | 880 | 11/5/2018 |
1.2.2 | 838 | 11/5/2018 |
1.2.1 | 869 | 11/5/2018 |
1.2.0 | 858 | 11/5/2018 |
1.1.0 | 836 | 11/4/2018 |
1.0.0 | 763 | 11/2/2018 |
Add helper constructor to ScrollView
Add optional Speech property to APLComponent needed for text/speech sync