feat(push): add foregroundRegistrationMode to re-register all users on foreground (W-20800537)#2935
Open
wmathurin wants to merge 3 commits into
Open
Conversation
Documents the push package in libs/SalesforceSDK: all key classes, registration lifecycle, re-registration modes, encryption, and testing.
…n foreground (W-20800537) Adds PushNotificationForegroundRegistrationMode enum (ALL_USERS / CURRENT_USER) and foregroundRegistrationMode property to PushService. Changes the default foreground re-registration behaviour to re-register all authenticated users rather than only the current user, matching the existing periodic mode. CURRENT_USER preserves pre-14.0 behaviour for Publisher customers billed per login. Android counterpart to iOS PR forcedotcom/SalesforceMobileSDK-iOS#4030.
…ssaging Extract foregroundPushRegistrationTarget() from onResume so tests can assert on the account-selection logic directly, avoiding MockK object mocking of PushMessaging which fails with 'Failed matching mocking signature' on CI.
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.
Summary
PushNotificationForegroundRegistrationModeenum (ALL_USERS/CURRENT_USER) toPushServicePushService.foregroundRegistrationModecompanion property (defaultALL_USERS)SalesforceSDKManager.onResumeto branch onforegroundRegistrationMode: passesaccount = nullforALL_USERS(worker iterates all authenticated users) or the current user forCURRENT_USERdocs/push/README.mdwith a new "Foreground Registration Mode" sectionPushServiceTestcovering default value, setter, and all foreground re-registration scenariosBehaviour change
Pre-14.0: foreground re-registration re-registers the current user only.
14.0+: foreground re-registration re-registers all authenticated users by default.
Apps that need the old behaviour (e.g. Publisher customers billed per login) set
PushService.foregroundRegistrationMode = CURRENT_USER.iOS counterpart
forcedotcom/SalesforceMobileSDK-iOS#4030
GUS
W-20800537
Test plan
./gradlew :libs:SalesforceSDK:build— passes./gradlew :libs:SalesforceSDK:assembleAndroidTest— passesPushServiceTeston device / Firebase Test Lab and confirm all 6 new foreground mode tests passPushServiceTestandPushMessagingTesttests are unaffected