0

I am trying to implement badger count on app launcher icon in flutter for all android based devices. I've tried flutter_app_badger and flutter_dynamic_icon as well but both of them aren't compatible with android. I wan't a unamious solution it's awesome if it works both for android or ios as well. I am trying to find solutions but there isn't enough data present. Onesignal push notification I am using for the app provides default badge count but it's not in all devices either. Please help me with the situation.

setLauncherNumber()async{
  // set batch number
  try {
    print('LauncherBadge inside try');
    // FlutterAppBadger.updateBadgeCount(10);
    await FlutterDynamicIcon.setApplicationIconBadgeNumber(93);
    print('LauncherBadge Success');
  } catch (e) {
    print('LauncherBadge error $e');
  }
}

flutter_app_badger and flutter_dynamic_icon arent compatible with all devices

  • On Android, no official API exists to show a badge in the launcher. But some devices (Samsung, HTC...) support the feature – Fugipe Oct 27 '22 at 13:44

1 Answers1

0

Use this package flutter_app_badger: ^1.5.0

import 'package:flutter_app_badger/flutter_app_badger.dart';

FlutterAppBadger.updateBadgeCount(1);

enter image description here

Anand
  • 4,355
  • 2
  • 35
  • 45
  • I've tried this plugin, but it's not compatible with every device. Also, it doesn't work with IOS devices either. I might be missing something and am kind of a beginner in this field. I am looking for a unanimous solution to be compatible with all devices including IOS. Please suggest me .... – Rushikesh Kumbhar Oct 29 '22 at 17:08