Hi All,
I am very new to this library. I successfully integrated this library with my project. I exactly followed the steps and I copied the same code that are present in the "example" project from this repo. I am getting notifications but when I clicked the action like ("Yes" or "No") buttons the notification is not closing. But Instead of clicking actions I clicked on the notification then the notification closed properly. Can someone please help me on this.? How to close the notification when I click the actions.?
You should manually close notification on action through NotificationManager, if we talk about Android.
@SpertsyanKM Thanks for your response.
After a one day struggle I found the way to delete the delivered notification by ID. Here is how I solved my problem.
PushNotification.clearLocalNotification(parseInt(id, 10));
Initially I am passing just ID but it's throwing an exception like "Can't cast string to double". So I converted to an Integer and passing that for clear.
Please let me know if I am making any mistake.
PushNotification.clearLocalNotification(parseInt(id, 10));
not working for LocalNotifications as well as for ScheduledNotifications...
It works for me <3 thanks!
not working for LocalNotifications as well as for ScheduledNotifications...
@Sanan4li I was having this issue too where PushNotification.clearLocalNotification(parseInt(id, 10)); was not clearing the notification when clicking an action.
To fix this, make sure that when you create your notification using PushNotification.localNotification that you do not specify a tag and group.
Most helpful comment
@SpertsyanKM Thanks for your response.
After a one day struggle I found the way to delete the delivered notification by ID. Here is how I solved my problem.
PushNotification.clearLocalNotification(parseInt(id, 10));Initially I am passing just ID but it's throwing an exception like "Can't cast string to double". So I converted to an Integer and passing that for clear.
Please let me know if I am making any mistake.