Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show subscription settings section either when subscription purchase is possible or user is authenticated #2922

Merged

Conversation

miasma13
Copy link
Contributor

@miasma13 miasma13 commented Jun 6, 2024

Task/Issue URL: https://app.asana.com/0/414709148257752/1207502776093440/f

Description:
Logic for displaying Privacy Pro section in settings always relies on canPurchase value (base on availability of subscription products for your region in the App Store). This check is even applied when the subscription was already purchased/activated on this device.
This logic is not aligned with macOS where we check for canPurchase only for unauthenticated state, otherwise if the user is already authenticated (we stored their accessToken) the Privacy Pro is made accessible in the UI.

Steps to test this PR:

  1. Purchase a subscription
  2. Open settings and confirm that subscription section is visible
  3. Ensure canPurchase to be false by launching the app while device is offline or hardcode it in SettingsViewModel.swift in line 768: state.subscription.canPurchase = false // subscriptionManager.canPurchase
  4. Open settings and confirm that subscription section is still visible
  5. Remove subscription from the device
  6. Confirm that the subscription section is gone (due to the forced disabled canPurchase)
  7. Re-enable canPurchase by undoing step 3.
  8. Open settings and confirm that subscription section is visible once again

Device Testing:

  • iPhone
  • iPad

Internal references:

Software Engineering Expectations
Technical Design Template

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to iOS App Board Asana project label Jun 6, 2024
@miasma13 miasma13 removed the bot: not in app board Added by automation for pull requests with tasks not added to iOS App Board Asana project label Jun 6, 2024
@miasma13 miasma13 requested a review from samsymons June 6, 2024 13:55
@miasma13 miasma13 merged commit 9eb5b42 into release/7.123.0 Jun 7, 2024
23 of 24 checks passed
@miasma13 miasma13 deleted the michal/fix-subscription-section-visibility branch June 7, 2024 08:15
samsymons added a commit that referenced this pull request Jun 7, 2024
* main: (34 commits)
  Release 7.122.1-0 (#2932)
  Fix widgets init due to crash of availability check inside builder on iOS 16 (#2931)
  Show subscription settings section either when subscription purchase is possible or user is authenticated (#2922)
  Release 7.123.0-1 (#2928)
  Do not refresh UI only if AutoClear was triggered (#2924)
  Do not refresh UI only if AutoClear was triggered (#2924)
  Clean up subscription state caching in settings logic (#2925)
  Force Omni Bar cancellation when submitting a query (#2923)
  Hide 'Set your address bar position' for iPad (#2913)
  Select correct access group for SubscriptionTokenKeychainStorage (#2918)
  Remove VPN waitlist feature flags and access controller (#2919)
  Remove usage of token store from iOS VPN (#2892)
  Update autoconsent to v10.9.0 (#2908)
  Load child Privacy Pro views lazily (#2917)
  Surface specific XPC & login item errors on macOS (#2872)
  Removing the temporary password manager survey code (#2910)
  Release 7.123.0-0 (#2915)
  Use better wording for history autocomplete description (#2914)
  Additional Privacy Pro RMF changes (#2911)
  Bump BSK - No iOS Changes, Enables macOS DBP Changes (#2877)
  ...
samsymons added a commit that referenced this pull request Jun 9, 2024
# By Michal Smaga (6) and others
# Via Michal Smaga (3) and GitHub (1)
* main:
  DBP: Bump C-S-S version to 5.19.0 (#2927)
  Release 7.123.0-2 (#2933)
  Fix widgets init due to crash of availability check inside builder on iOS 16 (#2931)
  Release 7.122.1-0 (#2932)
  Fix widgets init due to crash of availability check inside builder on iOS 16 (#2931)
  Show subscription settings section either when subscription purchase is possible or user is authenticated (#2922)
  Release 7.123.0-1 (#2928)
  Do not refresh UI only if AutoClear was triggered (#2924)
  Clean up subscription state caching in settings logic (#2925)
  Force Omni Bar cancellation when submitting a query (#2923)
  Remove Privacy Pro line from release notes (#2902)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
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.

2 participants