[UIApplication sharedApplication].applicationState sometimes returns inactiveState all the time, but the app is actually in the foreground and is not obscured by any other app or notification.
I am using the iOS12 system and this problem has occurred.
What do you think the problem is ?
Seen this SO thread?
If you're also seeing a small sample pool, I'd file a bug and see what comes back, and/or burn a support ticket w/DTS and ask them to take a look at a project that demonstrates the issue.