Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature requests #10

Open
JCKodel opened this issue Jul 26, 2020 · 3 comments
Open

Feature requests #10

JCKodel opened this issue Jul 26, 2020 · 3 comments

Comments

@JCKodel
Copy link

JCKodel commented Jul 26, 2020

  1. Customize the notification (for example, using Big Text Style notification)
    image

  2. Customize or disable the notification sound (I can't update the notification showing "In N minutes" because every update triggers a sound and would be annoying to the user)

  3. Support for minimized notifications (the last one in both example pictures)

  4. I don't know how it is called, but be able to change this part of the notification:
    image

@FabulousGee
Copy link
Contributor

FabulousGee commented Jul 30, 2020

For your 4th feature request - this is already implemented! It's called "subtext". Use as follows:

void main() {
  runApp(MyApp());
  startForegroundService();

  // if you need to stop foreground service,
  // await FlutterForegroundPlugin.stopForegroundService();
}

void startForegroundService() async {
  await FlutterForegroundPlugin.setServiceMethodInterval(seconds: 5);
  await FlutterForegroundPlugin.setServiceMethod(globalForegroundService);
  await FlutterForegroundPlugin.startForegroundService(
    holdWakeLock: false,
    onStarted: () {
      print("Foreground on Started");
    },
    onStopped: () {
      print("Foreground on Stopped");
    },
    title: "Flutter Foreground Service",
    content: "This is Content",
    iconName: "ic_stat_hot_tub",
    subtext: "JCKodel",
  );
}

void globalForegroundService() {
  debugPrint("current datetime is ${DateTime.now()}");
}

Though there is a little bug in the current plugin code - I'll create a pull request shortly and edit my answer here.

Edit: See #11

@JCKodel
Copy link
Author

JCKodel commented Jul 30, 2020

This is the "little" bug?

image

@FabulousGee
Copy link
Contributor

Yes, IMHO this is a little bug since it is really easy to find and fix. Got really some other kind of issues with some other plugins :-)

I already created a pull request, so feel free to integrate this in your copy of the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants