Command repeat all time


#1

I’m creating an ionic code and I need to have the notifications appear from the moment the user enters the dashboard. That is, from the hrario that it enters, will appear a notification to him every 12 hours. I was putting his notifications code on an IonViewWillEnter, but every time I entered the dashboard page, this notification appeared. What I wanted was that from a schedule only, notifications would come up, not every time it comes in. Can anybody help me ?


#2

Use localStorage to save the last time the notification cames up.
3 cases :
–> Never poped: so pop it up.
–> Poped more than 12 hours: so pop it up
for the 2 cases, update the last time in the local storage.
–> Poped less than 12 hours: so wait.