Code Monkey home page Code Monkey logo

Comments (6)

rlepinski avatar rlepinski commented on September 25, 2024 1

The work on our queue is to add the following methods:

  • setBadgeNumber
  • getBadgeNumber
  • setAutoBadgeEnabled
  • isAutoBadgeEnabled

You probably will be able to get to the work before we do, so if you wan't to add to the plugin I can help you. The react-native module has these methods already so you could take a look at how that is done.

from airship-flutter.

rlepinski avatar rlepinski commented on September 25, 2024

Thanks for the feedback, Ill add this request to our work queue

from airship-flutter.

lo-re-co avatar lo-re-co commented on September 25, 2024

Thanks for the feedback, Ill add this request to our work queue

Thank you, also the flutter SDK doesn't provide a method to reset the badge counter.
Working on native swift code it is possible to hide it when the user open the app, but on a new notification message the counter will just increment by 1. (the backend payload is configured to do so).

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
  override func applicationWillEnterForeground(_ application: UIApplication) {
   application.applicationIconBadgeNumber = 0;
  }

  override func applicationDidBecomeActive(_ application: UIApplication) {
      application.applicationIconBadgeNumber = 0;d
  }
}

from airship-flutter.

rlepinski avatar rlepinski commented on September 25, 2024

You send absolute values through the payload, not increment. In order to use the increment feature, we have to sync the count from the device to our backend. If you are in native code, you could add a call to UAirship.push().isAutobadgeEnabled = true

from airship-flutter.

lo-re-co avatar lo-re-co commented on September 25, 2024

You send absolute values through the payload, not increment. In order to use the increment feature, we have to sync the count from the device to our backend. If you are in native code, you could add a call to UAirship.push().isAutobadgeEnabled = true

While this has become clear over numerous trials and errors, a very important feature I'd wish this library had is the possibility to:

  • set auto badge enabled from the flutter library's dart code (initializing Airship through native code when you have already done so by using this lib is not ideal and a bit of a pain);

  • ability to have the Airship.resetBadge() method in Flutter too. I feel like this is a very important feature missing for the Flutter Library.

Thanks for the reply!

from airship-flutter.

lore-co avatar lore-co commented on September 25, 2024

While I've already solved this server side I truly appreciate the reactivity and the work you put on your side.
Also, nice cat!

P.s. you can mark this thread as closed if you wish so

from airship-flutter.

Related Issues (20)

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.