Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g123k/flutter_app_badger
Support to update the app badge on the launcher (both for Android and iOS)
https://github.com/g123k/flutter_app_badger
android badge dart dartlang flutter ios launcher
Last synced: 3 months ago
JSON representation
Support to update the app badge on the launcher (both for Android and iOS)
- Host: GitHub
- URL: https://github.com/g123k/flutter_app_badger
- Owner: g123k
- License: apache-2.0
- Archived: true
- Created: 2018-04-10T19:17:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T23:56:39.000Z (6 months ago)
- Last Synced: 2024-09-15T18:23:17.449Z (4 months ago)
- Topics: android, badge, dart, dartlang, flutter, ios, launcher
- Language: Objective-C
- Homepage: https://pub.dev/packages/flutter_app_badger
- Size: 160 KB
- Stars: 308
- Watchers: 10
- Forks: 161
- Open Issues: 55
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter App Badger plugin (UNMAINTAINED)
[![Pub](https://img.shields.io/pub/v/flutter_app_badger.svg)](https://pub.dartlang.org/packages/flutter_app_badger)
This plugin for [Flutter](https://flutter.io) adds the ability to change the badge of the app in the launcher.
It supports iOS, macOS, and some Android devices (the official API does not support the feature, even on Oreo).
## Getting Started
### iOS
On iOS, the notification permission is required to update the badge.
It is automatically asked when the badge is added or removed.Please also add the following to your /ios/Runner/Info.plist:
```xml
UIBackgroundModes
remote-notification
```## macOS
On macOS, the notification permission is required to update the badge.
It is automatically asked when the badge is added or removed.Please also add the following to your /macos/Runner/Info.plist:
```xml
NSUserNotificationAlertStyle
banner
```### Android
On Android, no official API exists to show a badge in the launcher. But some devices (Samsung, HTC...) support the feature.
Thanks to the [Shortcut Badger library](https://github.com/leolin310148/ShortcutBadger/), ~ 16 launchers are supported.### Dart
First, you just have to import the package in your dart files with:
```dart
import 'package:flutter_app_badger/flutter_app_badger.dart';
```Then you can add a badge:
```dart
FlutterAppBadger.updateBadgeCount(1);
```Remove a badge:
```dart
FlutterAppBadger.removeBadge();
```Or just check if the device supports this feature with:
```dart
FlutterAppBadger.isAppBadgeSupported();
```