Better documentation for cancelLocalNotifications() on Android
See original GitHub issueThe documentation states that userInfo
is iOS only, however, it states that you can use a userInfo
dictionary as an argument for cancelLocalNotifications()
.
Could someone whose more familiar with this library update the documentation to clarify:
- What does the argument for
cancelLocalNotifications
actually do (if anything) on Android? - How do you cancel individual scheduled local notifications on Android? (What parameters can you use to match notifications?)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Android – Delete previous notification(s) using react-native ...
cancelLocalNotifications({id: myId}) , but the documentation explicitly says that cancelLocalNotifications() only cancels scheduled notifications (and I'm ...
Read more >Delete previous notification(s) using react-native-push ...
The docs for react-native-push-notification state that you can cancel a ios local notification using userInfo like this: PushNotification.
Read more >react-native-fcm-fix: Documentation - Openbase
cancelAllLocalNotifications() FCM.cancelLocalNotification("UNIQ_ID_STRING") FCM.setBadgeNumber(1); // iOS only and there's no way to set it in Android, yet.
Read more >Local Notifications | React Native Notifications
postLocalNotification() method return unique notificationId values, ... of the iOS equivalent that works more naturally with the Android perception of push ...
Read more >react-native-push-notification - npm
React Native Local and Remote Notifications for iOS and Android ... NOTE: localNotification() works without changes in the application part, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I was able to finally find success with this cancelLocalNotifications method.
The README leads us to believe that the following will work for android: PushNotification.localNotificationSchedule({ userInfo: { id: ‘123’} }); PushNotification.cancelLocalNotifications({ id: ‘123’ });
But it does not…
Instead, do this: PushNotification.localNotificationSchedule({ id: ‘123’ }); PushNotification.cancelLocalNotifications({ id: ‘123’ });
Confirm it working. But only with string type of property ID