NativeScript / NativeScript/plugins
@nativescript/local-notifications custom sound not working
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 206
- Forks
- 123
- Merge moyen
- 2 j 1 h
- PR mergées (30 j)
- 1
Description
Hi All, I've been trying to look out for a solution on the internet, and even tried to understand the source code with no avail.
I'm trying to schedule a local notifications as follows
LocalNotifications.schedule([ {
id: id,
title: `Some title`,
sound: 'res://silent.wav',
ongoing: true,
notificationLed: false,
forceShowWhenInForeground: false,
priority: 0,
actions: actions,
icon: 'res://icon',
} ])
and the notification is displayed correctly. And that's fine. The only problem is that the sound file which I am specifying is not being played, and instead the default android notification sound of the device is playing.
I've even tried using silent.wav and silent as values... I even tried passing <any>null as indicated in the README but nothing worked.
The silent.wav file is located in App_Resources/Android/src/main/res/raw and App_Resources/iOS respectively
Something worth mentioning is that I've been trying this out on Android 11.
Any help and pointers would be greatly appreciated.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le README de local-notifications et l’implémentation Android, en utilisant l’appel de planification signalé et Android 11 comme cas de reproduction. Vérifiez comment la valeur de App_Resources/Android/src/main/res/raw/silent.wav est traitée ; c’est terminé lorsque la notification planifiée joue le son personnalisé spécifié au lieu du son par défaut de l’appareil.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, typescript
- Domaine
- mobile-dev
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100