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

Added support for showManageSubscriptions on Storekit 2 #2058

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

timbrandin
Copy link
Contributor

This PR adds support for showManageSubscriptions: https://developer.apple.com/documentation/storekit/appstore/3803198-showmanagesubscriptions

  • This panel is very useful for testing where one can cancel the subscription and avoid waiting for expire and additional renewals.
  • This panel is very user friendly allowing users to cancel or change their subscription without going to the App Store or Settings app to find their subscription.

reject: @escaping RCTPromiseRejectBlock = { _, _, _ in }
) {
#if !os(tvOS)
guard let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a better way of getting the scene? I was using await UIApplication.shared.keyWindow?.windowScene on beginRefundRequest line :915

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, maybe this is faster as it isn't async? But I'm not a Swift/Objective-C expert

@andresesfm andresesfm merged commit 29d008d into hyochan:main Oct 19, 2022
@kyle-ssg
Copy link

kyle-ssg commented Mar 16, 2023

I was looking around for this functionality. If I'm not mistaken this PR does not actually expose this function in iosSk2.js ?

With that being the case, it looks like people can just achieve this at the moment by doing

   const { RNIapIosSk2 } = NativeModules

   RNIapIosSk2.showManageSubscriptions().catch(() => {
      Linking.openURL('https://apps.apple.com/account/subscriptions')
    })

It's a really great option that has been introduced, well worth documenting!

@andresesfm
Copy link
Contributor

Addressed your request on #2376 @kyle-ssg

@andresesfm
Copy link
Contributor

released as 12.10.2

@kyle-ssg
Copy link

Amazing

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.

3 participants