EddyVerbruggen / nativescript-local-notifications

:mailbox: NativeScript plugin to easily schedule local notifications
MIT License
162 stars 57 forks source link

Triple notifications and no text #171

Closed andresilva-cc closed 4 years ago

andresilva-cc commented 4 years ago

When I'm scheduling a notification to now, the system shows 3 notifications (instead of just one), and there's no text at all, you can see this in the screenshot below:

Screenshot_20191021_025346

I'm testing on an Android emulator running version 5.1.

My code:

             LocalNotifications.schedule({
                  title: 'Alerta',
                  body: `Uma ocorrência de ${occurrence.category.name} foi registrada próxima ao seu local atual`,
                  bigTextStyle: true
                })

Already tried without bigTextStyle, but same thing. PS: I'm using local notifications on a Background Service.

andresilva-cc commented 4 years ago

This also happens on Android 9.

andresilva-cc commented 4 years ago

Sample project: https://github.com/DeehSlash/nativescript-local-notifications-bug

EddyVerbruggen commented 4 years ago

Can you at least include the at property, so the plugin has an idea when to trigger it? I don't know if that helps, but I always do it (like in the demo apps) and don't have this problem.

andresilva-cc commented 4 years ago

Already solved, see: https://stackoverflow.com/questions/58492792/plugin-nativescript-local-notifications-triplicates-the-notification-and-theres

As pointed by Manoj, I was passing an Object to the Schedule method, not an Array, so that was the problem.