NativeScript / NativeScript/plugins
[@nativescript/localNotifications] - Android LocalNotifications.hasPermission() returns false after accepting notifications with firebase messaging
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 206
- Forks
- 123
- Ø Merge
- 2 T. 1 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Android-Verhalten mit @nativescript/local-notifications 6.4.0, @nativescript/android 8.9.1 und @nativescript/firebase-messaging 5.0.2 zu reproduzieren. Verfolge LocalNotifications.hasPermission(), requestPermissions() und firebase().messaging().requestPermission(); abgeschlossen ist die Aufgabe, wenn erteilte Benachrichtigungsberechtigungen erkannt werden und LocalNotifications.schedule nicht mehr mit Permission not granted fehlschlägt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android, typescript
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 42/100