Skip to content

Add foregroundRegistrationMode enum to re-register all users on app foreground#4030

Merged
sfdctaka merged 4 commits into
forcedotcom:devfrom
sfdctaka:reregisterNotification
May 11, 2026
Merged

Add foregroundRegistrationMode enum to re-register all users on app foreground#4030
sfdctaka merged 4 commits into
forcedotcom:devfrom
sfdctaka:reregisterNotification

Conversation

@sfdctaka
Copy link
Copy Markdown
Contributor

@sfdctaka sfdctaka commented May 6, 2026

  1. 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
  1. New property foregroundRegistrationMode: .allUsers replaces the old Bool
  2. 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
  3. onAppWillEnterForeground — now switches on the mode: iterates UserAccountManager.shared.userAccounts() for .allUsers, falls back to current-user-only for .currentUser

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

TestsPassed ✅SkippedFailed
AuthFlowTester UI Test Results all1 ran1 ✅
TestResult
No test annotations available

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.32%. Comparing base (3cdaf5f) to head (5669051).
⚠️ Report is 5 commits behind head on dev.

Files with missing lines Patch % Lines
...ses/PushNotification/PushNotificationManager.swift 75.00% 3 Missing ⚠️
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     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 70.79% <ø> (-0.19%) ⬇️
Core 61.85% <75.00%> (-3.31%) ⬇️
SmartStore 73.44% <ø> (ø)
MobileSync 88.79% <ø> (ø)
Files with missing lines Coverage Δ
...ses/PushNotification/PushNotificationManager.swift 83.54% <75.00%> (+1.48%) ⬆️

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^26 Test Results631 ran630 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^26 Test Results
SFUserAccountManagerTests.testUserAccountEncoding❌ failure

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

TestsPassed ✅SkippedFailed
SalesforceSDKCore iOS ^18 Test Results631 ran631 ✅
TestResult
No test annotations available

@sfdctaka sfdctaka marked this pull request as ready for review May 7, 2026 22:25
@sfdctaka sfdctaka changed the title [DRAFT] Add foregroundRegistrationMode enum to re-register all users on app foreground Add foregroundRegistrationMode enum to re-register all users on app foreground May 7, 2026
@sfdctaka sfdctaka requested a review from bbirman May 7, 2026 22:26
Comment thread libs/SalesforceSDKCore/SalesforceSDKCoreTests/PushNotificationManagerTests.swift Outdated

@available(*, deprecated, renamed: "foregroundRegistrationMode",
message: "Use foregroundRegistrationMode instead. Set .none for false, .allUsers for true.")
public var registerOnForeground: Bool {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice way to have a migration from the old to new property!

Copy link
Copy Markdown
Contributor

@wmathurin wmathurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sfdctaka sfdctaka merged commit 15d5016 into forcedotcom:dev May 11, 2026
26 of 30 checks passed
@sfdctaka sfdctaka deleted the reregisterNotification branch May 11, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants