-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add action sheet with payment options for 30 and 90 days #7468
Add action sheet with payment options for 30 and 90 days #7468
Conversation
7e79f74
to
5aa7664
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 13 of 15 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @SteffenErn)
ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
line 113 at r2 (raw file):
button.setAccessibilityIdentifier(.purchaseButton) let localizedString = NSLocalizedString( "BUY_CREDIT_BUTTON",
Rename to ADD_TIME_BUTTON.
ios/MullvadVPN/Coordinators/OutOfTimeCoordinator.swift
line 87 at r2 (raw file):
} func outOfTimeViewControllerDidRequestShowPurchaseOptions(
Showing purchases options is done the same way in multiple places. Could we move this logic into a view model, helper or something similar to reduce code duplication?
ios/MullvadVPN/View controllers/Account/AccountViewController.swift
line 199 at r2 (raw file):
} // purchaseButton.setTitle(productState.purchaseButtonTitle, for: .normal)
Remove if not used.
ios/MullvadVPN/View controllers/Account/AccountViewController.swift
line 269 at r2 (raw file):
return } let productIdentifiers = Set(StoreSubscription.allCases)
No need to use a Set here.
ios/MullvadVPN/View controllers/Account/AccountViewController.swift
line 270 at r2 (raw file):
} let productIdentifiers = Set(StoreSubscription.allCases) setIsFetchingProducts(true)
Requesting products is done in multiple places. Could we perhaps move most of the body/validation into the interactor instead? That way we don't risk validating differently in various places. Also reduces code duplication.
ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeInteractor.swift
line 31 at r2 (raw file):
didSet { guard viewDidLoad else { return } // Might trigger a popup without user interaction do we want that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 13 of 15 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @pinkisemils and @SteffenErn)
ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeInteractor.swift
line 31 at r2 (raw file):
Previously, rablador (Jon Petersson) wrote…
Since there's no requestAccessToStore
method to find for now, I'd say let's delete this ?
Regarding the popup, in general we try to not show popups without user interaction in the first place.
ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeViewController.swift
line 229 at r2 (raw file):
@objc private func requestStoreProducts() { guard let accountData = interactor.deviceState.accountData else {
You can do guard interactor.deviceState.accountData != nil
instead to avoid the warning here
ios/MullvadVPN.xcodeproj/project.pbxproj
line 5994 at r2 (raw file):
7A1A26472A29CF0800B978AA /* RelayFilterDataSource.swift in Sources */, 5864AF0929C78850005B0CD9 /* VPNSettingsCellFactory.swift in Sources */, F998EFFA2D3656BA00D88D01 /* SKProduct+Sorting.swift in Sources */,
We try to keep things more or less organized by alphabetical order in the project structure, you can use the Sort by Name
function on the Extensions
folder to that effect.
5aa7664
to
1abac1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 15 files reviewed, 8 unresolved discussions (waiting on @buggmagnet, @pinkisemils, and @rablador)
ios/MullvadVPN/Coordinators/OutOfTimeCoordinator.swift
line 87 at r2 (raw file):
Previously, rablador (Jon Petersson) wrote…
Showing purchases options is done the same way in multiple places. Could we move this logic into a view model, helper or something similar to reduce code duplication?
Good point, I will move the creation of the action sheet into one place
ios/MullvadVPN/View controllers/Account/AccountViewController.swift
line 199 at r2 (raw file):
Previously, rablador (Jon Petersson) wrote…
Remove if not used.
Done.
ios/MullvadVPN/View controllers/Account/AccountViewController.swift
line 269 at r2 (raw file):
Previously, rablador (Jon Petersson) wrote…
No need to use a Set here.
requestProducts functions requires a Set
ios/MullvadVPN/View controllers/Account/AccountViewController.swift
line 270 at r2 (raw file):
Previously, rablador (Jon Petersson) wrote…
Requesting products is done in multiple places. Could we perhaps move most of the body/validation into the interactor instead? That way we don't risk validating differently in various places. Also reduces code duplication.
I don't think there is much we could extract from the viewcontrollers. The only check that could be moved is if the result was successful but empty and instead return a failure. But since this is not a final design or flow I would wait with that since we might want to display a different error message in that case.
ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
line 113 at r2 (raw file):
Previously, rablador (Jon Petersson) wrote…
Rename to ADD_TIME_BUTTON.
Done.
ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeInteractor.swift
line 31 at r2 (raw file):
Previously, buggmagnet wrote…
Since there's no
requestAccessToStore
method to find for now, I'd say let's delete this ?Regarding the popup, in general we try to not show popups without user interaction in the first place.
Done.
ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeViewController.swift
line 229 at r2 (raw file):
Previously, buggmagnet wrote…
You can do
guard interactor.deviceState.accountData != nil
instead to avoid the warning here
Done.
ios/MullvadVPN.xcodeproj/project.pbxproj
line 5994 at r2 (raw file):
Previously, buggmagnet wrote…
We try to keep things more or less organized by alphabetical order in the project structure, you can use the
Sort by Name
function on theExtensions
folder to that effect.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 9 files at r3, 6 of 6 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @buggmagnet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 9 files at r3, 6 of 6 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
7ca198c
to
91cb3e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
Adds the 90 day payment option to the account view, out of time view and welcome view.
Hint: Test "out of time" view by presenting it right on app launch.
ApplicationCoordinator.swift:140
This change is