パッケージ、リポジトリ、アプリカテゴリを検索

app_badge_plus のカバー
パッケージ詳細v1.4.0

app_badge_plus

アプリのアイコンにバッジを追加するためのFlutterプラグイン。iOS、Android、macOSをサポートしています。

AndroidiOSmacOS
30日間ダウンロード
38.1万
いいね数
172
Pub ポイント
160

パッケージをインストール

flutter pub add app_badge_plus

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

AppBadgePlus は、Android、iOS、macOS プラットフォームのアプリアイコンにバッジを表示できる Flutter プラグインです。通知、メッセージ、タスクインジケーターなどに役立つ、バッジカウントを動的に更新するためのシンプルな API を提供します。既存の Flutter アプリにスムーズに統合でき、整数およびカスタムバッジラベルの両方をサポートしています。クロスプラットフォームでの一貫性を重視して設計されており、各オペレーティングシステムが対応している範囲でバッジが表示されます。ホーム画面アイコン上でリアルタイムのステータス更新が必要なアプリに最適です。

用途

  • 未読メッセージの件数を表示
  • 保留中のタスク通知を表示しています
  • 新しいコンテンツの利用可能を示す
  • リアルタイムでアプリアイコンバッジを更新する
  • 視覚的サインを通じたユーザー参加の促進

主な機能

  • クロスプラットフォーム対応(Android、iOS、macOS)
  • バッジ更新のためのシンプルな API
  • 整数およびカスタムバッジラベルのサポート
  • リアルタイムバッジレンダリング
  • 最小限のセットアップとインテグレーション

適している対象

  • メッセージングおよびチャットアプリケーション
  • タスクおよび生産性アプリ
  • 通知が多く含まれるアプリ
  • 動的コンテンツ更新付きのアプリ
  • 複数のプラットフォームをターゲットにする開発者

注意事項

  • バッジのサポートは、プラットフォームやOSバージョンによって異なります
  • 一部のプラットフォームでは、バッジカウントのサイズが制限される場合があります
  • すべてのデバイスがカスタムバッジテキストをサポートしているわけではありません
  • 一部のシステムでは、プラットフォーム固有の権限が必要です
  • 限定されたビジュアルカスタマイズオプション

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

app_badge_plus

Pub Version Pub Points GitHub

A Flutter plugin for adding badges to your app icon. Supports iOS, Android, and macOS.

iOS pixel samsung macOS

Supported Platforms

  • iOS
  • Android
    • Samsung (pass)
    • Oppo (pass)
    • Vivo (pass)
    • Huawei (pass)
    • Xiaomi / POCO (HyperOS)
    • LG
    • Sony
    • HTC
    • ZTX
  • macOS

Mark

Android

Starting with Android 8.0 (API level 26), notification badges—also known as notification dots—appear on a launcher icon when the associated app has an active notification. Users can touch & hold the app icon to reveal the notifications, along with any app shortcuts.

https://developer.android.com/develop/ui/views/notifications/badges

Starting With Android13 (API level 33), notification runtime permission should be requested before setting the app badge.

On POCO / Xiaomi HyperOS, numeric badges are driven by active notifications (the old extraNotification API is unavailable). Grant notification permission and enable the numeric badge style in system settings.

Add the following permissions to AndroidManifest.xml according to the system you need to support:

<!-- Samsung -->
<uses-permission android:name="com.sec.android.provider.badge.permission.READ"/>
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>

<!-- HTC -->
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT"/>

<!-- Sony -->
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>
<uses-permission android:name="com.sonymobile.home.permission.PROVIDER_INSERT_BADGE"/>

<!-- Apex -->
<uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT"/>

<!-- Solid -->
<uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE"/>

<!-- Huawei -->
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE" />
<uses-permission android:name="com.huawei.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.huawei.android.launcher.permission.WRITE_SETTINGS" />
iOS

On iOS, when using with notification message, notification permission is required.

macOS

On macOS, when using with notification message, notification permission is required.

permission_handler

Using permission_handler package to manage permission on Android and iOS.

https://pub.dev/packages/permission_handler

Usage

To use this plugin, add app_badge_plus as a dependency in your pubspec.yaml file.

dependencies:
  app_badge_plus: ^1.1.2

Example

import 'package:app_badge_plus/app_badge_plus.dart';

// Set badge
AppBadgePlus.updateBadge(5);

// Remove badge
AppBadgePlus.updateBadge(0);

// Whether the launcher supports badges. It always returns true on iOS and it will return false on Android if the launcher doesn't support badges.
AppBadgePlus.isSupported();

Compare

flutter_app_badger

https://pub.dev/packages/flutter_app_badger

Set badge
FlutterAppBadger.updateBadgeCount(1);

replace to

AppBadgePlus.updateBadge(1);
Remove badge
FlutterAppBadger.removeBadge();

replace to

AppBadgePlus.updateBadge(0);
Device support
FlutterAppBadger.isAppBadgeSupported();

using dart API:

import 'dart:io';

Platform.isAndroid || Platform.isIOS

カテゴリー

依存関係

依存関係一覧 1 件

  • plugin_platform_interface^2.1.8

ソースリポジトリ

このパッケージを使用しているプロジェクト