Closed alecrem closed 6 years ago
Adding the following to the ILocalNotification interface allowed me to properly build the app, but I don't know if it should be more specific:
trigger?: any;
I still don't know how I got the wrong version, and there seem to be other people finding the same issue. Hope this can help someone. This fixed it:
npm update @ionic-native/local-notifications
Thanks, @alecrem. It worked for me as well. But now i'm getting typescript compilation error. "In ambient enum declarations member initializer must be constant expression."
Resolved that as well by updating typescript.
Neither of the above solutions worked.
Neither
npm update @ionic-native/local-notifications
nor
npm install typescript@latest -g
worked for me.
Below is my ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v6.14.0
npm : 3.10.10
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145
Environment Variables:
ANDROID_HOME : ~/Library/Android/sdk
Misc:
backend : pro
I am still having this issue. Is this fixed?
I still can not use trigger: { every: { month: 10, day: 27, hour: 9, minute: 0 } }
beacuase type of every
only expects ELocalNotificationTriggerUnit
which an enum for string not an object.
If anyone is still struggling with this, this works for me (after some hair-pulling): Instead of 'second' specify ELocalNotificationTriggerUnit.SECOND Same should go for other triggers such as "every".
this.localNotifications.schedule({
id: 123,
foreground: true,
text: '5 sec test',
trigger: {in:5,unit:ELocalNotificationTriggerUnit.SECOND}
});
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
Current behavior: My iOS app will work on livereload, so I think my copy of the Cordova plugin works with
trigger
, but the transpiler won't allow the property so I can't actually deploy the app. It seems to me that the ILocalNotification Interface in@ionic-native/local-notifications/index.d.ts
doesn't contemplate thetrigger
property because it's a newer object structure.Expected behavior: I should be able to schedule a local notification using the
trigger
property, or the examples on the Ionic Native Docs should be updated with the current right way to use the plugin.Steps to reproduce:
trigger
on the page's moduleRelated code: Example from the Ionic Native Docs, using
trigger
:Interface from
@ionic-native/local-notifications/index.d.ts
, doesn't have thetrigger
property in it:Other information: @mowaiskalam seems to be having the same issue.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):