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.

Notification with Progressbar remove or update

See original GitHub issue

I created a notification with a progress that I can properly update. When I reach 100% I would like to show a message “Download completed”. Unfortunately I could not find a documentation on how to replace the progress in the notification or how to remove the notification and add another. If it’s possible could you update the documentation?

Your Environment

  • Plugin version: “@ionic-native/local-notifications”: “^4.7.0”, “cordova-plugin-local-notification”: “^0.9.0-beta.2”,

  • Platform: Android

  • OS version: 8.1

  • Device manufacturer / model: LGE 4

  • Cordova version (cordova -v): 8.0.0

  • Ionic Version (if using Ionic): 3.20.0

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
kevinciang1006commented, May 8, 2020

I had a similar problem like @JhonnyJason mentioned but instead of using notificationHandle.clear({id: knownId}) i used notificationHandle.cancel({id: knownId})

so i tried tinkering with notificationHandle. Turns out when i tried this

// set sticky to false
notificationHandle.update({
      id: 5 // the knownId to cancel
      sticky: false,
    });

// then canceling it
notificationHandle.cancel(knownId); // or using notificationHandle.clear({id: knownId})

It works in my case. I manage to clear the notification per id

My Environment

Plugin version: “@ionic-native/local-notifications”: “^5.24.0”, “cordova-plugin-local-notification”: “^0.9.0-beta.4”,

Ionic:

Ionic CLI : 5.4.4 Ionic Framework : @ionic/angular 5.0.7 @angular-devkit/build-angular : 0.803.26 @angular-devkit/schematics : 8.3.26 @angular/cli : 8.3.26 @ionic/angular-toolkit : 2.2.0

Capacitor:

Capacitor CLI : 2.0.1 @capacitor/core : 2.0.1

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 7.1.4 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, (and 10 other plugins)

Utility:

cordova-res : 0.8.1 native-run : 1.0.0

System:

NodeJS : v10.15.0 (D:\Documents\NodeJs\node.exe) npm : 6.4.1 OS : Windows 10

Tested Platform: Android OS version: 9.0

0reactions
Fever905commented, May 27, 2019

That is not the best solution, cuz even when its set to done the tirmer will run on it. Can we not display the timer somehow?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Progress Notification with Examples - Tutlane
Once the operation is done leave the progress bar showing or remove it by calling setProgress(0,0, false) and update the notification text to...
Read more >
Displaying Progress in a Notification | Android Developers - MIT
You can either leave the progress bar showing when the operation is done, or remove it. In either case, remember to update the...
Read more >
Progress Bar within a Notification - Notifications in Android
My Online Courses https://stevdza-san.com☕ Buy me a Coffeehttps://ko-fi.com/stevdza_san ‍ Wanna become a member?
Read more >
PROGRESS BAR NOTIFICATION - Android Studio Tutorial
In part 6 of the notifications tutorial, we will learn how to add a ProgressBar to a notification and update it periodically.
Read more >
hide notification area progress bar in android when 100% is ...
28 · Here it is: Notification.setProgress(0, 0, false); ; 1 · I found a "solution" that works. Just call a new RemoteView with...
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