Take focus from game during calls on iOS #6462
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Again, this is not normal behaviour of any iOS app, as incoming calls have recently been acting more like a glorified notification than a full-screen overlay. However, as a rhythm game, exclusive access to the audio is required for the game to function appropriately, therefore we have to observe for incoming calls and cut focus from the game in order to be aware that it should not remain operating (i.e. send to pause screen).
Note that this change is made primarily because users would otherwise lose their scores when they get a call, as the beatmap freezes and osu! triggers the "you have an issue with your audio device, score will not be submitted" notification.
The framework may not be exclusively for rhythm games, but I think it's simple to have this anyway until we get a report about it from other framework consumers.