-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_reactNativePushNotification.default.cancelLocalNotification is not a function #2143
Comments
I have seen the similar open and closed issues regarding this issue and it does not change anything here when I am cleaning the cache |
Can you check the version directly in your |
@Dallas62 my package.json is:
|
@Degn, I'm also facing this issue. Were you able to find a solution? |
use cancelLocalNotifications({id: 1}) |
@cynde, thanks. cancelLocalNotifications({ id: 1 }) does not throw an error but it did not cancel my ongoing notification. I also tried PushNotification.removeDeliveredNotifications([ notificationId ]) but it didn't work too. |
PushNotification.removeDeliveredNotifications([ notificationId ]) eventually worked for me but I had to ensure that my notificationId is not "1". Other numbers worked fine. |
Id must be a string so it should be cancelLocalNotifications({id: "1"})
|
Can we expect a fix for |
The state of the repository is in the Readme. |
I had the same error, it seems to be an issue with the cache. I used a previous version with the function cancelLocalNotifications({id:"abc"}) But this method is now deprecated, so I update the package (version 8.1.1) and tried to use cancelLocalNotification("abc") It was due to two things. First one, the native function was not executed. (Even cleaning the cache and uninstalling/reinstalling the app) Second one, the id must be a string of integer, id="abc" did not work anymore but id="123" works. I hope it will help. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
I receive the following error message when I am calling
PushNotification.cancelLocalNotification(id)
:[TypeError: _reactNativePushNotification.default.cancelLocalNotification is not a function. (In '_reactNativePushNotification.default.cancelLocalNotification(id)', '_reactNativePushNotification.default.cancelLocalNotification' is undefined)]
I am using the following versions:
react-native-push-notification: 8.1.0
react-native: 0.65.0
I expect the function to cancel the scheduled push notification with the specific ID. Instead I receive the error message above. I have tested on both an iOS and Android device with the same result. Other PushNotification functions work fine.
The text was updated successfully, but these errors were encountered: