Show download progress in notification
The work for this plugin is in progress (Support Android done) try to support iOS and web (Any help is appretiated)
- Android
- iOS
npm install capacitor-notification-progressbar
npx cap sync android
After you install the plugin, locate your MainActivity.java (can be found in /android/app/src/main/java/path/to/my/app/MainActivity.java)
import plugin path
- import tn.converto.plugins.notification.download.progress.NotificationDownloadProgress;
And add Plugin class to init method
- add(NotificationDownloadProgress.class);
import tn.converto.plugins.notification.download.progress.NotificationDownloadProgress;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(NotificationDownloadProgress.class);
}});
}
}
import { Plugins } from '@capacitor/core';
const { NotificationDownloadProgress } = Plugins
- Create the notification
NotificationDownloadProgress.create({
contentTitle: 'Notification content title',
contentText: 'Notification content text',
destroyOnDone: false
})
- Create the notification
NotificationDownloadProgress.updateProgress({
progress: 50
doneTitle: 'Notification done title',
doneText: 'Download complete'
})