ionic-team / capacitor-background-runner

Other
37 stars 21 forks source link

CapacitorNotification Android scheduler #102

Open faller222 opened 3 weeks ago

faller222 commented 3 weeks ago

Regarding this, I'm using "@capacitor/background-runner": "1.1.0", I have found two problems.

faller222 commented 3 weeks ago

https://github.com/ionic-team/capacitor-background-runner/blob/e9dad483b08c9c8904e22606c28e4f09b8b6a441/packages/capacitor-plugin/android/src/main/java/io/ionic/backgroundrunner/plugin/api/Notification.kt#L38

here is the line is failing if I dont send scheduleAt

faller222 commented 3 weeks ago

Here is my workaround for the second issue

const magicOffset = new Date().getTimezoneOffset() * 60 * 1000

function fixDate(date){
    return new Date(date.getTime() - magicOffset)
}