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.