That's how I've been doing it in theory, but I moved away from doing it with the async APIs because they delay the call versus the traditional APIs, meaning for these specific APIs (entering foreground/background) they're no longer as accurate.
For instance
willEnterForegroundis (per docs) supposed to come, well, before foreground is entered, and it does with the old APIs, but not if you use an async sequence, which makes trusting theactivationStatedifficult.