Local Notifications foreground

Hey guys!

Here’s my dilemma that I can’t seem to come up with a solution for:

In my app the user has a timer which counts down to 0. The app sets a local notification for this time when it’s supposed to hit 0 and fires appropriately. Now where I am getting stuck is I want to make an audible noise of sorts to the user to let them know that the timer finished even if they are on the app. That difficult part is: When the user comes back to the app then the app fast forwards time to bring the timer to 0. SO if I have it ding at 0, the user is notified when they get the notification AND when they bring the app back to the foreground.

I really want to avoid the app notifying them twice (the second while they opened the app) because it looks buggy and bad.

Do you guys have any recommendations? I am using https://github.com/katzer/cordova-plugin-local-notifications/ for the local notifications and they have functions for if they click the notification and so forth but they don’t run until the app is brought back to the foreground, which eliminates the ability to not ding if they are coming from a notification.

I hope I explained it well, it’s not much of an Ionic problem as it is a cordova one. I just want to see if anyone has had success with it?

[Edit] More thoughts :

I just thought about putting the sound inside the notification callback so if it goes off while in the foreground that it will play, BUT, i run into that problem again where because the app comes to the foreground before the notification callback is called, it thinks it’s in the foreground. Even meta data wouldn’t work :skull: