Solved

Capacitor SDK: How to cancel subscriptions in-app using managementUrl

  • 1 November 2023
  • 1 reply
  • 108 views

Badge +2

I’ve been looking all over the internet and reading through RevenueCat documentation and have continued to come up short with this.  I would appreciate guidance from anyone who has done this before, as it’s driving me crazy.

I’m building an iOS app using Ionic/Capacitor and leveraging the brand new @revenuecat/purchases-capacitor SDK to manage receipt validation and the entire in-app-purchase life-cycle for Auto-Renewable subscriptions.  I’ve got everything working except for a way for the user to be taken to their App Subscriptions page (should they decide to cancel the subscription).

When retrieving customer info (which I do, right after configuration ‘Purchases.configure’) I store the returned managementUrl (which ends up being “https://apps.apple.com/account/subscriptions” for me).

My issue is:

  • I know this link is correct; If I enter it into Safari on my phone, it guides me straight to the phone’s App Subscription management page
  • When I navigate to this Url in my app using this.router.navigateByUrl(managementUrl) it fails and I get a noMatchError.  This makes sense, because I have no matching routes for the url.

So, how do I navigate to this page?  And why is it so hard to figure out how to do this part?

One last detail.  I’m migrating from cordova-plugin-purchase to revenue-cat and find it confusing why RevenueCat has chosen to leave out this part of the IAP life-cycle.  Cordova-plugin-purchase provided all the pieces, including a manageSubscriptions function which took me right there.

Other than this hangup, I’m loving the RevenueCat SDK, and it’s much simpler and intuitive to use as compared to cordova-plugin-purchase.

Thanks for your help in advance, it’s really appreciated.

icon

Best answer by scott-kehler-d901fe 2 November 2023, 15:36

View original

1 reply

Badge +2

Ok, I was overthinking this 😣.  All I had to do was add an href to me unsubscribe button.  Definitely an unfortunate mistake.  I would delete this if I could… argh.

Reply