Skip to content

Support to update the app badge on the launcher (both for Android and iOS)

License

Notifications You must be signed in to change notification settings

Tom3652/flutter_app_badger

This branch is 2 commits ahead of, 12 commits behind g123k/flutter_app_badger:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

753362a · Jan 21, 2022

History

31 Commits
Jan 21, 2022
Apr 10, 2018
Jan 21, 2022
Jan 21, 2022
Jan 21, 2022
Dec 3, 2019
Sep 15, 2021
Apr 10, 2018
Sep 13, 2019
Apr 10, 2018
Apr 10, 2018
Sep 15, 2021

Repository files navigation

Flutter App Badger plugin

Pub

This plugin for Flutter adds the ability to change the badge of the app in the launcher. It supports iOS and some Android devices (the official API does not support the feature, even on Oreo).

Android badge

Android badge

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 Info.plist:

<key>UIBackgroundModes</key>
    <array>
        <string>remote-notification</string>
    </array>

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, ~ 16 launchers are supported.

Dart

First, you just have to import the package in your dart files with:

import 'package:flutter_app_badger/flutter_app_badger.dart';

Then you can add a badge:

FlutterAppBadger.updateBadgeCount(1);

Remove a badge:

FlutterAppBadger.removeBadge();

Or just check if the device supports this feature with:

FlutterAppBadger.isAppBadgeSupported();

About

Support to update the app badge on the launcher (both for Android and iOS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 26.8%
  • Objective-C 26.1%
  • Dart 25.6%
  • Java 21.5%