cancelLocalNotification error
Trying to cancel a local notification. I assume this is to remove the notification from the notification center
const notificationIds = []
const notification: Notification = {
title: `My Takeouts`,
body: 'You have a new order'
};
for (const id of notificationIds) {
Notifications.cancelLocalNotification(id.toString());
}
const notificationId = Notifications.postLocalNotification(notification);
notificationIds.push(notificationId);
I get a native error
java.lang String cannot be cast to java.lang.Double
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
+1
I've discovered that the notification id parameter in the function cancelLocalNotification(notificationId) must be a number even though the inferred type by the lib is string.
Notifications.cancelLocalNotification(1); will work while diplaying a linter error and Notifications.cancelLocalNotification('1'); will display no error on your code editor but will give you that native error.
cancelLocalNotification doesn't work on android
also postLocalNotification fires immediately on android regardless of the fireDate
they have a not about this in the docs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.