NativeScript / NativeScript/plugins

@nativescript/local-notifications custom sound not working

Aberta
#259 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Linguagem predominante
TypeScript
Estrelas
206
Forks
123
Merge médio
2d 1h
PRs com merge (30d)
1

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece pelo README de local-notifications e pela implementação do Android, usando a chamada de agendamento relatada e o Android 11 como caso de reprodução. Verifique como o valor de App_Resources/Android/src/main/res/raw/silent.wav é tratado; considera-se concluído quando a notificação agendada reproduzir o som personalizado especificado em vez do som padrão do dispositivo.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
android, typescript
Domínio
mobile-dev
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
38/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.