Cordova-plugin-local-notifications: trigger at not working

Created on 22 Mar 2018  路  2Comments  路  Source: katzer/cordova-plugin-local-notifications

WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Notifications works but not if I set a date-time to be shown

Your Environment

  • Plugin version: 0.9.0-beta.3 "LocalNotification"
  • Platform: iOS
  • OS version: 11.2.6
  • Device manufacturer / model: iPhone 8
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls):
    Installed platforms:
    android 7.0.0
    ios 4.5.4
  • Plugin config
    cordova-plugin-badge 0.8.6 "Badge"
    cordova-plugin-camera 4.0.1 "Camera"
    cordova-plugin-config-alert 1.0.0 "config-alert"
    cordova-plugin-console 1.1.0 "Console"
    cordova-plugin-device 2.0.1 "Device"
    cordova-plugin-dialogs 2.0.1 "Notification"
    cordova-plugin-file 6.0.1 "File"
    cordova-plugin-file-transfer 1.7.1 "File Transfer"
    cordova-plugin-geolocation 4.0.1 "Geolocation"
    cordova-plugin-inappbrowser 2.0.1 "InAppBrowser"
    cordova-plugin-local-notification 0.9.0-beta.3 "LocalNotification"
    cordova-plugin-network-information 2.0.1 "Network Information"
    cordova-plugin-splashscreen 5.0.1 "Splashscreen"
    cordova-plugin-whitelist 1.3.3 "Whitelist"
    cordova-plugin-x-toast 2.6.0 "Toast"
  • Ionic Version (if using Ionic)

Expected Behavior

_Tell us what should happen_
notification should be shown at a certain date-time

Actual Behavior

no notification is shown
_Tell us what happens instead_

Steps to Reproduce

_Reproduce this issue; include code to reproduce, if relevant_
I tried to uninstall and reinstall the plugin many times.
last experiment with a brand new app
from console: this works

cordova.plugins.notification.local.schedule({
    id:1,
    title: 'Uno',
    text: '3:00 - 4:00 PM',
    foreground: true,

});

this not works:

cordova.plugins.notification.local.schedule({
    id:3,
    title: 'Tre',
    text: '3:00 - 4:00 PM',
    foreground: true,
    trigger: { at:  new Date(2018, 3, 22, 10, 53) }
});

also isn't working

cordova.plugins.notification.local.schedule({
    id:90,
    title: 'Tre',
    text: '3:00 - 4:00 PM',
    foreground: true,
    trigger: { at: (new Date()).getTime() }
});

Context

_What were you trying to do?_

Debug logs

_Include iOS / Android logs_

  • ios XCode logs
  • Android: $ adb logcat

All 2 comments

Look at https://github.com/katzer/cordova-plugin-local-notifications/issues/1524

There is working code in there. Your last example is wrong as you need to set the time in the future by a few seconds.

No response in four weeks so closing.

Was this page helpful?
0 / 5 - 0 ratings