AndroidNotification::VibrateTimingsMillis not operating as documented

Abierto
#322 3 comentarios 0 reacciones 2 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@chong-shao ya está trabajando en esto.

Desde el 30/3/2022.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

api: messaging
[REQUIRED] Step 2: Describe your environment
  • Operating System version: Windows 10 Enterprise
  • Firebase SDK version: 2.3.0
  • Firebase Product: Firebase Cloud Messaging
  • .NET version: 6.0
  • OS: Windows 0 Enterprise
[REQUIRED] Step 3: Describe the problem

The AndroidNotification::VibrateTimingMillis property is documented as follows:

Gets or sets a list of vibration timings in milliseconds in the array to use. The first value in the
array indicates the duration to wait before turning the vibrator on. The next value
indicates the duration to keep the vibrator on. Subsequent values alternate between
duration to turn the vibrator off and to turn the vibrator on.

Today I wanted to send a notification that would vibrate for 500 milliseconds, so I set this property as follows:

AndroidNotification notification = new
{
    DefaultVibrateTimings = false,
    VibrateTimingsMillis = new long[] { 0, 500 }
};

On the device though, this resulted in a very long vibration, that lasted for several seconds.

After experimenting, sending a value of { 0, 1 } results in a vibration lasting 1 second - I've reviewed the relevant code for this (in VibrateTimingsString) and tested it on its own, and the above code results in the value 0s, 0.500000000s being sent to the API, which appears correct.

I'm not sure if this is a fault on the device I was testing against as it is running a very dated version of Android unfortunately (we're stuck with it due to customer requirements and it's stuck on Android 7.1.1).

PS: I also noticed a few possible micro-optimisations that could be made to some of this new code, such as pre-sizing the list for the timingsStringList, I'm not sure if it's worth opening a PR for these changes.

Lenguaje dominante
C#
Estrellas
408
Forks
147
Merge medio
1 d 3 h
PR fusionados (30 d)
10

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de firebase/firebase-admin-dotnet

Todos los issues de firebase/firebase-admin-dotnet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.