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

Feature: manage subscriptions modal #532

Closed
wants to merge 10 commits into from
Closed

Feature: manage subscriptions modal #532

wants to merge 10 commits into from

Conversation

aboedo
Copy link
Member

@aboedo aboedo commented Jun 18, 2021

This is a PoC.

It adds a new method, showManageSubscriptionsModal, which will show the SK2 manage subscriptions modal if available, and otherwise will open up the manageSubscriptionsURL from RC.

The logic is a bit more nuanced, but that's the basic stuff.

To achieve this and keep all the rest, this adds a new module PurchasesSwift (name will absolutely change before merging), which imports all of the original Purchases, while adding Swift extensions.

I tested that this can be used from objective-c and Swift (which is a clear win over SK2), as well as macOS and iOS (SK2's version only supports iOS).
Also, this takes into account the managementURL, so if a user purchased a subscription through Android, they'll go to the corresponding managementURL instead.

If there's no managementURL, I'm currently defaulting to the native one in the OS, but that's subject to change. That also conflicts with a known bug in managementURL for purchases on HOLD status in Android.

@aboedo aboedo self-assigned this Jun 18, 2021
}

@MainActor
@available(iOS 15.0, *)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it potentially be possible to batch these into a single custom annotation? i can see us repeating these lines alllll over the place

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we'd be able to do it at the extension declaration level, and it'd apply to everything in it.

@aboedo
Copy link
Member Author

aboedo commented Aug 19, 2021

closing in favor of #756

@aboedo aboedo closed this Aug 19, 2021
@aboedo aboedo mentioned this pull request Nov 16, 2021
@NachoSoto NachoSoto deleted the feature/sk2 branch May 26, 2023 17:16
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