Coder Social home page Coder Social logo

hongjie104 / flutter_app_badger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from g123k/flutter_app_badger

0.0 2.0 0.0 175 KB

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

License: Apache License 2.0

Java 19.10% Ruby 29.24% Objective-C 24.01% Dart 27.65%

flutter_app_badger's Introduction

Flutter App Badger plugin

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:flutterappbadger/flutterappbadger.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();

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.