CurrieTechnologies.Blazor.Vibration 0.1.0

A Blazor component library for interacting withthe browser vibration API.
Use in Client-side Blazor apps.

There is a newer version of this package available.
See the version list below for details.
Install-Package CurrieTechnologies.Blazor.Vibration -Version 0.1.0
dotnet add package CurrieTechnologies.Blazor.Vibration --version 0.1.0
<PackageReference Include="CurrieTechnologies.Blazor.Vibration" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CurrieTechnologies.Blazor.Vibration --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CurrieTechnologies.Blazor.Vibration

This package provides Blazor applications with access to the browser's Vibration API

This package is for Client-side Blazor only. For Server-side Blazor use CurrieTechnologies.Razor.Vibration

Usage

  1. In your Blazor app, add the CurrieTechnologies.Blazor.Vibration NuGet package

    Install-Package CurrieTechnologies.Blazor.Vibration
    
  2. In your Blazor app's Startup.cs, register the 'VibrationService'.

    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddVibration();
        ...
    }
    
  3. Now you can inject the VibrationService into any Blazor page and use it like this:

    @using CurrieTechnologies.Blazor.Vibration
    @inject VibrationService vibrationService
    
    <button @onclick="@(async e => await vibrationService.VibrateAsync(1000))">Vibrate for 1 second</button>
    <button @onclick="@(async e => await vibrationService.VibrateAsync(new int[] { 200, 100, 200 }))">
      Vibrate on and off
    </button>
    

Vibrate() and VibrateAsync() are both available.

CurrieTechnologies.Blazor.Vibration

This package provides Blazor applications with access to the browser's Vibration API

This package is for Client-side Blazor only. For Server-side Blazor use CurrieTechnologies.Razor.Vibration

Usage

  1. In your Blazor app, add the CurrieTechnologies.Blazor.Vibration NuGet package

    Install-Package CurrieTechnologies.Blazor.Vibration
    
  2. In your Blazor app's Startup.cs, register the 'VibrationService'.

    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddVibration();
        ...
    }
    
  3. Now you can inject the VibrationService into any Blazor page and use it like this:

    @using CurrieTechnologies.Blazor.Vibration
    @inject VibrationService vibrationService
    
    <button @onclick="@(async e => await vibrationService.VibrateAsync(1000))">Vibrate for 1 second</button>
    <button @onclick="@(async e => await vibrationService.VibrateAsync(new int[] { 200, 100, 200 }))">
      Vibrate on and off
    </button>
    

Vibrate() and VibrateAsync() are both available.

Release Notes

Initial Release

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.2.0 135 7/24/2019
0.1.0 118 6/18/2019