question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android cancelLocalNotification not working

See original GitHub issue

Hello,

When I am trying to cancel notification.

PushNotification.cancelLocalNotification(id); I also used this PushNotification.cancelLocalNotification({id:id});

I get this error.

TypeError: _reactNativePushNotification.default.cancelLocalNotification is not a function. (In '_reactNativePushNotification.default.cancelLocalNotification(id)', '_reactNativePushNotification.default.cancelLocalNotification' is undefined)

TypeError: _reactNativePushNotification.default.cancelLocalNotification is not a function. (In '_reactNativePushNotification.default.cancelLocalNotification({ id: id })', '_reactNativePushNotification.default.cancelLocalNotification' is undefined)

npm version 6,14,9 node version v15.2 “react-native-push-notification”: “^7.0.0” “react-native”: “0.63.4”,

When I create a schedule. PushNotification.localNotificationSchedule({ channelId:"channel", // (required) title:"title", invokeApp: true, date: date, id: uu, //uuid string message: "message", allowWhileIdle:false, }); Android Studio properties ` android { compileSdkVersion 30 buildToolsVersion “30.0.2”

defaultConfig {
    applicationId "com.example.myapplication"
    minSdkVersion 23
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"
}

`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
oguzhannkayaacommented, Sep 5, 2021

@Dallas62 I upgrade to “react-native-push-notification”: “^7.4.0”, But still getting error. I deleted the app and rebuild npx react-native start --reset-cache

0reactions
Dallas62commented, Sep 12, 2021

If so, clear your cache or provide a full description of your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cancelLocalNotifications() does not work on Android #2100
The problem here is that the matches method in RNPushNotificationAttributes.java is being used incorrectly in this case. That method tries to ...
Read more >
React Native PushNotification.cancelLocalNotifications not ...
I'm trying to do simple reminder app with RN and zo0r / react-native-push-notification and I'm not able to cancel notification from its ...
Read more >
CancelLocalNotification - Unreal Engine 5 Documentation
Whether you're a beginner or a seasoned pro, we have the help you need to succeed. ... Access Epic Games' premium fee-based support...
Read more >
Manage notifications in React Native with ... - LogRocket Blog
This guide assumes that you are running React Native v10.x. With npm: ... Linking react-native-notifications with Android.
Read more >
How to Read and Cancel Local Notification Requests
We can also remove all pending or even delivered notifications requests from the user notification center and to do that we do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found