Creating a local Reminder

I created a PWA using framework7 cli.
How can i add a reminder for a certain (date and time)?
i want the reminder trigger even if the app is closed!

1 Like

You probably mean Push notifications? It is possible only on Android. But you will need to manually implement ā€œweb push notificationsā€ - google this phrase for examples on the web :slight_smile:

I found you need to use the master branch. The older versions didnā€™t work for me.

hello my friend
i think this is the right thing for me but could you tell me where should i put below code? (because on my pages cordova is not recognized!)

cordova.plugins.notification.local.schedule({
title: ā€˜Design team meetingā€™,
text: ā€˜3:00 - 4:00 PMā€™,
trigger: { at: new Date(2017, 10, 27, 15) }
});

Hi Peyman. You need to install the plugin:

cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#master

I did install it man.
I just want to know on which files ā€œcordova.plugins.notification.local.scheduleā€ is recognizable?

no, i just want to add an event to phone local calendar.

If the plugin is installed correctly ā€œcordova.plugins.notification.local.scheduleā€ will be available globally (all files). It should be accessible from the global window object also i.e. window.cordova.plugins.notification.local.schedule

It doesnā€™t work.
here is what i did:
1.created a react + cordova project with f7 cli.
2.opened terminal an navigated to cordova folder
3.ran command ā€œcordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#masterā€
4.in my home.jsx file added :
componentDidMount() {
alert ( cordova.plugins.notification.local.schedule({
title: ā€œDesign team meetingā€,
text: ā€œ3:00 - 4:00 PMā€,
trigger: { at: new Date(2019, 9, 28, 28) }
}) );
}
5.build apk using npm run build-cordova-dev

But it printed Undefined and didnt add any reminder!
what should i do my friend?

Hi Peyman. Did you get any error messages when you installed the plugin? I had to manually install one or two other plugins based on the error messages produced by ā€œcordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#masterā€ in order to get it working.

Iā€™m pretty sure i did everything right.
If you could show me the code you used for setting a new local notification in your project i would be very thankful!

Hi Peyman. Iā€™m sure you can figure the rest out with the about clues. If you need detailed help I am available for hire. Just send me a direct message.