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

Sound and vibration not working! #13

Open
valeriomarchetti opened this issue Jul 21, 2021 · 0 comments
Open

Sound and vibration not working! #13

valeriomarchetti opened this issue Jul 21, 2021 · 0 comments

Comments

@valeriomarchetti
Copy link

valeriomarchetti commented Jul 21, 2021

Hi dear,
I have a problem with enableSound and enableVibration. These flags seem are not working if I set both to true.

void periodicTaskFun() {
  FlutterForegroundServicePlugin.executeTask(() async {
    // this will refresh the notification content each time the task is fire
    // if you want to refresh the notification content too each time
    // so don't set a low period duretion because android isn't handling it very well
    await FlutterForegroundServicePlugin.refreshForegroundServiceContent(
      notificationContent: NotificationContent(
          iconName: 'ic_launcher',
          titleText: 'Title Text',
          bodyText: '${DateTime.now()}',
          subText: 'subText',
          color: Colors.red,
          enableSound: true,
          enableVibration: true),
    );

    print(DateTime.now());
  });
}

I have also tried to change the NotificationContent priority and the NotificationChannelContent importance, but nothing..

P.S. I have already set the android permission to the AndroidManifest

<uses-permission android:name="android.permission.VIBRATE" />

Could you help me?

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

1 participant