Hey,
I would like to monitor whether my app is going to the background or comes back to the foreground. Then everytime when it stays in the background for more than 1min I would like to sent an information to my JS code and trigger some function there.
I tried to set an observer through NotificationCenter to check app position (background/foreground) but then in the selector I am not able to make a connection between my Swift and JS code.
I also tried with userContentController. Firstly send a message from JS and handle it using replyHandler but this is a one-time action and I couldn't call replyHandler every time the timer on the swift side will expire.
Is there any way I can notify my JS about app being in the background for more than 1min without the need of constantly sending messeges from JS code?