Giter Site home page Giter Site logo

knottx / flutter_app_badger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from g123k/flutter_app_badger

0.0 0.0 0.0 163 KB

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

Home Page: https://pub.dev/packages/flutter_app_badger

License: Apache License 2.0

Ruby 26.06% Objective-C 32.03% Java 15.18% Dart 26.73%

flutter_app_badger's Introduction

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, macOS, 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 /ios/Runner/Info.plist:

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

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:

<key>NSUserNotificationAlertStyle</key>
<string>banner</string>

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();

flutter_app_badger's People

Contributors

g123k avatar fzyzcjy avatar atrope avatar f-person avatar ariejan avatar edward-yakop avatar g-30 avatar johnmartel avatar mathiascochet avatar riscait avatar bannzai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.