Giter Site home page Giter Site logo

Comments (4)

rafaelsetragni avatar rafaelsetragni commented on September 24, 2024

Can you send me your notification creation code as an example?
And also send me what system are you running, which version and whats is your plugin version?

from awesome_notifications.

 avatar commented on September 24, 2024
  • macOS Catalina (10.15.5)
  • Samsung m30s
  • Android 10 (Q)
  • awesome_notifications: ^0.0.5+2

//////////////// Example ////////////////

AwesomeNotifications().initialize(
'resource://drawable/ic_launcher',
[
NotificationChannel(
channelKey: 'appointment_channel',
channelName: 'Appointment Alert',
channelDescription: '',
importance: NotificationImportance.Max, // High, Max
defaultPrivacy: NotificationPrivacy.Public,
icon: 'resource://drawable/ic_launcher',
enableLights: true,
playSound: true,
enableVibration: true,
onlyAlertOnce: false,
locked: true,
ledOnMs: 1000,
ledOffMs: 500,
defaultColor: Colors.red,
ledColor: Colors.blue,
vibrationPattern: Int64List.fromList(
List.generate(30, (index) => index % 2 == 0 ? 500 : 1000)
.toList())),
],
);

////////////////

Future showNotification () async {

final scheduleDate = DateTime.now().add(Duration(minutes: 1));

await AwesomeNotifications().createNotification(
  content: NotificationContent(
    id: 12,
    channelKey: 'appointment_channel',
    title: "*** Appointment Alert ***",
    body: "",
    autoCancel: false,
    locked: true,
    showWhen: true,
    color: appColor.red,
    ticker: 'ticker1',
    payload: {
      "data": "hiii",
    },
  ),
  actionButtons: [
    NotificationActionButton(
        buttonType: ActionButtonType.KeepOnTop,
        key: "CANCEL",
        label: "Cancel",
        autoCancel: true),
    NotificationActionButton(
        buttonType: ActionButtonType.Default,
        key: "OPEN",
        label: "Open",
        autoCancel: true)
  ],
  schedule: NotificationSchedule(
    allowWhileIdle: true,
    crontabSchedule: CronHelper.instance
        .atDate(scheduleDate.toUtc(), initialSecond: 0),
  ),
);

}

from awesome_notifications.

rafaelsetragni avatar rafaelsetragni commented on September 24, 2024

I did not check what happened, but ill do as soon as possible.

from awesome_notifications.

rafaelsetragni avatar rafaelsetragni commented on September 24, 2024

Sorry for take so long. I have fixed it, was a "copy and paste" mistake inside json conversion method.

returnedObject.put(Definitions.NOTIFICATION_DISPLAY_ON_FOREGROUND, this.autoCancel);

returnedObject.put(Definitions.NOTIFICATION_DISPLAY_ON_BACKGROUND, this.autoCancel);

This fix will be available on next release.

from awesome_notifications.

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.