-
Notifications
You must be signed in to change notification settings - Fork 327
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
Conversation
…tends it with sk2 functionality.
} | ||
|
||
@MainActor | ||
@available(iOS 15.0, *) |
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.
would it potentially be possible to batch these into a single custom annotation? i can see us repeating these lines alllll over the place
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.
I think we'd be able to do it at the extension declaration level, and it'd apply to everything in it.
closing in favor of #756 |
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 themanageSubscriptionsURL
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 originalPurchases
, 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 correspondingmanagementURL
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.