NativeScript / NativeScript/plugins
[@nativescript/localNotifications] - Android LocalNotifications.hasPermission() returns false after accepting notifications with firebase messaging
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
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
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 reproduire le comportement Android avec @nativescript/local-notifications 6.4.0, @nativescript/android 8.9.1 et @nativescript/firebase-messaging 5.0.2. Suivez LocalNotifications.hasPermission(), requestPermissions() et firebase().messaging().requestPermission() ; c’est terminé lorsque les autorisations de notification accordées sont reconnues et que LocalNotifications.schedule n’échoue plus avec Permission not granted.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, typescript
- Domaine
- mobile
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 42/100