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.

Clear local notifications not working with "ongoing" notification

See original GitHub issue

I am creating a local notification like so:

pushNotification.localNotification(
  {
    "message" : "Connected to MAP",

    "autoCancel"  : false,
    "id"          : "12345",
    "ongoing"     : true,
    "playSound"   : false,
    "vibrate"     : false
  }
);

And attempting to clear it like so:

pushNotification.cancelLocalNotifications(
  {
    "id"  : "12345"
  }
);

However, the notification will not clear. This seems like a simple enough use case. Am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

8reactions
iberatkayacommented, Mar 2, 2020

I had the exact problem. Setting the repeatType parameter to a string solved the problem for me. I am not sure about the reason this occurs.

PushNotification.localNotification({
    id: (UserData.lastid - 1).toString(),
    message: this.props.data.label,
    ongoing: true,
    repeatType: 'minute'
});

PushNotification.cancelLocalNotifications({ id: activeProcess.id.toString() });

0reactions
github-actions[bot]commented, Aug 19, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Notifications Not Showing Up? 10 Fixes You Can Try
Not seeing notifications show up on your Android phone? Try these fixes to get Android notifications working again.
Read more >
(Phonegap) How to clear local notifications on app close ...
Meaning that any ongoing clock local notification will still appear and running on the notification tray even after the app closed.
Read more >
How to get rid of a permanent notification on Android
From the Recently sent section, tap the app whose permanent notification you want to remove. If you don't see the app in the...
Read more >
awesome_notifications | Flutter Package - Pub.dev
Create Local Notifications on Android, iOS and Web using Flutter. ... Media Source Types; Notification Importance (Android's channel); Common Known Issues.
Read more >
Scheduling local notifications - a free Hacking with iOS
Remote notifications require a server to work, because you send your message to Apple's push notification service (APNS), ...
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