Fix balance notification subscription issue #2027
Merged
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.
Description
Ticket: CP-9389
when trying to subscribe to the backend, we will skip the logic if the balance notification prompt has not been presented to user. this means users will never receive any notifications. this happens in 2 cases AFAIK:
case 1:
Open Device Settings
Balance
switch)Balance
notification switch is displayed with ON valuecase 2
Balance
notification switch is displayed with OFF valueBalance
notification switch to ONthis pr fixes the above issue by:
Open Device Settings
is clicked, we only enable all the switches that are displayed to the user at the timeBalance
notification switch is OFF.Screenshots/Videos
I did some testing with these scenarios
1/ disable balance notification flag -> install fresh app -> enable balance notification flag -> reopen app -> approve prompt
https://github.com/user-attachments/assets/eae99b8b-78d5-4040-b30a-a644084f26fe
2/ disable balance notification flag -> install fresh app -> enable balance notification flag -> reopen app -> deny approve prompt -> enable Balance switch
https://github.com/user-attachments/assets/cbf9e0b8-c33d-49d0-a45a-7e05ad74558b
3/ disable balance notification flag -> install fresh app -> enable balance notification flag -> enable Balance switch
https://github.com/user-attachments/assets/2114aa4a-f96c-46d0-918b-50abe7b9dcb7
Testing
Please make sure 1/ notifications are still working correctly based on user preferences and 2/ production users who are not receiving notifications will start receiving them with this fix
Checklist
Please check all that apply (if applicable)