Add foregroundRegistrationMode enum to re-register all users on app foreground#4030
Merged
Merged
Conversation
Contributor
sfdctaka
commented
May 6, 2026
- New enum PushNotificationForegroundRegistrationMode (before PushNotificationManagerError):
- .none — no re-registration on foreground
- .currentUser — re-register only the current user (preserves pre-14.0 behavior)
- .allUsers — re-register all logged-in users (new default)
- Doc comment calls out the Publisher/per-login billing concern explicitly
- New property foregroundRegistrationMode: .allUsers replaces the old Bool
- Deprecated shim for registerOnForeground: Bool — kept as a computed property that maps to the new enum, so existing apps don't break with a compiler error, just a deprecation warning
- onAppWillEnterForeground — now switches on the mode: iterates UserAccountManager.shared.userAccounts() for .allUsers, falls back to current-user-only for .currentUser
|
||||||||||||||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #4030 +/- ##
==========================================
- Coverage 70.46% 68.32% -2.15%
==========================================
Files 245 245
Lines 21449 21457 +8
==========================================
- Hits 15115 14661 -454
- Misses 6334 6796 +462
🚀 New features to boost your workflow:
|
|
||||||||||||||||
|
||||||||||||||
bbirman
reviewed
May 8, 2026
|
|
||
| @available(*, deprecated, renamed: "foregroundRegistrationMode", | ||
| message: "Use foregroundRegistrationMode instead. Set .none for false, .allUsers for true.") | ||
| public var registerOnForeground: Bool { |
Member
There was a problem hiding this comment.
nice way to have a migration from the old to new property!
bbirman
approved these changes
May 11, 2026
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.