NativeScript / NativeScript/plugins
[@nativescript/localNotifications] - Android LocalNotifications.hasPermission() returns false after accepting notifications with firebase messaging
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 206
- Fork
- 123
- Merge medio
- 2g 1h
- PR unite (30g)
- 1
Descrizione
Info
"@nativescript/local-notifications": "^6.4.0",
"@nativescript/android": "8.9.1",
"@nativescript/firebase-messaging": "5.0.2",
Problem
Both LocalNotifications.hasPermission() and LocalNotifications.requestPermissions() return false in a application with already given permissions for push notifications. This does not allow for usage of the LocalNotifications.schedule with error
This piece of code
const authStatus = await firebase() .messaging() .requestPermission(<any>{});
console.log('Android - checking notification permissions ...', authStatus);
const aceptedLocalNotifications = await LocalNotifications.hasPermission();
console.log('Android - LocalNotifications.requestPermission', aceptedLocalNotifications);
returns
Android - checking notification permissions ... 0
Android - LocalNotifications.requestPermission false
Error
Error in LocalNotifications.requestPermission: Error: Permission not granted
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il comportamento Android con @nativescript/local-notifications 6.4.0, @nativescript/android 8.9.1 e @nativescript/firebase-messaging 5.0.2. Traccia LocalNotifications.hasPermission(), requestPermissions() e firebase().messaging().requestPermission(); il lavoro è completato quando le autorizzazioni per le notifiche concesse vengono riconosciute e LocalNotifications.schedule non fallisce più con Permission not granted.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, typescript
- Ambito
- mobile
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 42/100