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

[Winback] Apply Apple API for subscription cancellation #2474

Merged

Conversation

danielebogo
Copy link
Contributor

@danielebogo danielebogo commented Nov 21, 2024

📘 Part of: #2435

Fixes #2444
Fixes #2445

This PR uses the StorerKit.AppStore API to present the subscriptions panel and handle those

To test

  • CI must be 🟢
  • Make sure you enabled winback FF
  • Use a real device with a sandbox account
  • Use a Plus/Patron account or a free account and purchase a Plan
  • Got to your account, Cancel Subscription
  • Tap on Continue to Cancellation
  • On the new screen tap on Yes, Cancel my Subscription
  • You should see the Apple screen to manage the sunscription
  • Tap on cancel the subscriptions
  • Dismiss the view
  • Now, the API to check the receipt may take some times. I need to investigate if we can get the new status quickly. If the state doesn't reload try to force reload your account till the new status updates

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@danielebogo danielebogo added this to the 7.78 milestone Nov 21, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Nov 21, 2024

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is assigned to the milestone 7.78. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@danielebogo danielebogo marked this pull request as ready for review November 25, 2024 10:43
@danielebogo danielebogo requested a review from a team as a code owner November 25, 2024 10:43
@@ -25,7 +26,29 @@ class CancelConfirmationViewModel: OnboardingModel {
Analytics.track(.cancelConfirmationCancelButtonTapped)

if FeatureFlag.winback.enabled {
//TODO: Add Apple API
Task {
guard let windowScene = await navigationController.view.window?.windowScene else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this code to be refactored to a separated function that could part of IAPHelper in order to better contain any StoreKit code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SergioEstevao I part of it to the IAPHandler. All the part related to the groupID and StoreKit, so now everything is well decoupled

@SergioEstevao SergioEstevao self-requested a review November 25, 2024 12:11
Copy link
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Functionality wise is working correctly, just asked for a code change.

@SergioEstevao SergioEstevao self-requested a review November 25, 2024 13:33
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ danielebogo
❌ Daniele Bogo


Daniele Bogo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the suggestion!
:shipit:

@danielebogo danielebogo merged commit bf35d2d into trunk Nov 26, 2024
3 of 6 checks passed
@danielebogo danielebogo deleted the danieleb/Winback/2444-2445-current-subscription-screen branch November 26, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Winback] Implement StorerKit API to present the Apple Subscription screen [Winback] Add confirmation screen
4 participants