Repository navigation
Conversation
The alert is presented both when permissions are checked and when launch playback replays an unacknowledged record. When playback ran after the check (a slow launch, e.g. a Core Data migration), both presented, and the controller was only remembered after presentation finished, so nothing stopped the second copy. Remember the controller before presenting, skip presenting while one exists, and forget it when the user closes it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The "Turn On Alarms" (unsafe notification permissions) alert could stack several copies at launch.
It is presented from two places: the permissions check, and launch playback of its unacknowledged AlertStore record. Playback normally runs first and the check then sees the alert as already issued. On a slow launch, such as one running a Core Data migration, playback runs after the check has issued and recorded the alert, so it presents a second copy. The controller was only remembered after presentation finished, so nothing stopped it.
This stores the controller before presenting, skips presenting while one exists, and clears it when the user taps Close or Settings so the alert can be shown again later.
Testing, simulator, alarms not authorized:
Not exercised: a permission change while the app is running (re-show after Close in the same process, or retraction after granting alarms). Both paths clear the stored controller.