How to compare two dates and send me a notification

Hi guys
Can someone help me?
I would like to buy 2 dates.
If the visit date is more than 1 week from the current date, a notification message will be displayed.
I can’t make the notification appear.
Follow the EIA.
AppRevisitaTESTE.aia (2.6 KB)

Blocks please…

you can use extension or a method,
Extension: by @vknow360

Method: by @pavi2410

1 Like

How you will know when is the visit date?

This date I inform (manual)

AppRevisitaTESTE.aia (12.7 KB)

1 Like

Thank you for your help, @George_Loungos
See below as I want. Only the notification is missing.

Logic: If the date above (visit) is 7 days less than the date lower (current). Give me a notification.

Note: The date above is editable, but the date below is automatic according to the current phone date.

I made some more modifications and it looked like this:
Follow AIA
AppRevisitaTESTE.aia (12.9 KB)

Note: I just can’t do the comparison logic. If the visit date is shorter (7 days) than the current date, a notification will be displayed.
blocks

A Message Dialog will only appear when the app runs. You may want to send push notifications with Onesignal.

rrpkC
(An example to MessageDialog)

Hello Friend @Robert
Notification is exiting correctly. But not in the right logic.
The logic would be as follows: If the visit date is shorter (7 days) than the current date, it will display a message on the screen.

Yes, currently you can send notification by Kodular, but only if the app runs. You can store the start date in TinyDB and check if there is less than 7 days remaining at application starts and e.g. every half hour (if it is open).

Yes, that’s the goal, only if the app runs.

Than you are good to go:

  1. When asked, store the date in ms.
  2. Extract stored date from Clock.Now in ms.
    If it is less than 604,800,000; send notification. (Do the second task frequently but not in every second as it may cause you app to lag.)
1 Like

Can you help me in assembling the blocks? On top of that logic.

No extensions needed.
There’s 604800000 milliseconds in a week. Knowing that, you need to get how many milliseconds are in between the two dates (in instants), compare it with 604800000 and if it’s greater, then more than a week passed between both dates.

image

4 Likes

Hello @Italo
Thanks
I did it, but it’s giving me an error!

Screenshot_2

Hey,
As You want to send your users a notification if they have not opened the app for a week, the simplest way to do that is by implementing One Signal in your app.
If you want to know how can this be implemented ask me for the same.
Thanks,
Warm Regards

Screenshot_2

As shown by the error, the date of the visit and the current date is more than a week, so when opening the app, it was to show the notification.

[AppRevisitaTESTEsssssssssss.aia|attachment]AppRevisitaTESTEsssssssssss.aia (13.6 KB)

What do you want to accomplish by sending notification?