Displaying Progress in a Notification Bar

I want to display progress in push notification like native android downloads works.
Is there any way to do it in Ionic?

Can you show an example?
Do you know any other apps doing anything like that?

image
I want to do something like this.

Ok. But:

Only if you have an example we can start investigating.

for example, in android while updating any app from playstore, we see downloading progress of the update in notification bar.
I want to do the same for my app while downloading any image, video and attachment file in ionic v1.image

Yes, but that is not a normal app but part of the OS. You need an example of an app doing something like this, then we can investigate how the app does it and see if we can do the same in Ionic.

No, I don’t have such example so I was showing similar kind of example for it.
Is it possible in ionic for doing this.

Ionic itself - no.
Ionic Apps via Cordova plugins - maybe. But only if other apps are able to do this too.

Some more research into this:

Seems to be possible in Android in general: https://developer.android.com/training/notify-user/display-progress.html

But couldn’t find any Cordova plugin supporting the setProgress() on local notifications :confused:

Only thing I did find is this “hack” on an existing Cordova plugin: https://stackoverflow.com/a/31909537/252627

So can you suggest any alternative thing for this in ionic.

@nikhil7
Did you get any solution for this so far?

This plugin should do the trick https://github.com/katzer/cordova-plugin-local-notifications

@Daskus
Thank you for suggestion.
But if possible then can you show an example that how the download percentage will increase as download goes on?

I think you just need to reschedule the notification:

for(int i=0; i<=10; i++){
   cordova.plugins.notification.local.schedule({
       title: 'Sync in progress',
       text: 'Copied ' + i + 'of 10 files',
       progressBar: { value: i*10 }
    });
}

U can use css for a progress bar

Place a div on top using z-index and change the progress using width and a percentage

See line 5 in https://github.com/Tommertom/Newzee/blob/master/src/pages/homepage/homepage.html

The progress percentage variable should deliver a string ending with %

And if angular cant catch up with your progress changes u possibly need to wrap it in a zonej

Thanks for the suggestion.