11

A user has subscribed to my auto-renewable in app subscription. I want to provide a button called "Manage subscription".

This should jump to the App Store under the subscription management for my specific app.

What URL should I redirect to achieve this?

5 Answers5

23

This is the new URL that should be used:
https://apps.apple.com/account/subscriptions

Nimantha
  • 6,405
  • 6
  • 28
  • 69
i4guar
  • 599
  • 5
  • 10
  • 1
    from this doc https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/subscriptions_and_offers/handling_subscriptions_billing?language=objc – RY_ Zheng Oct 05 '21 at 05:51
8

From the Apple documentation:

Rather than needing to code your own subscription management UI, your app can open the following URL: https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions Opening this URL launches iTunes or iTunes Store, and then displays the Manage Subscription page.

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
samir
  • 4,501
  • 6
  • 49
  • 76
  • 1
    I am trying to open this link itmss://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions for managing subscription in my iPhone but it ends up in a blank screen and doesn't show anything. Have anyone else facing this problem? – Umair Aamir Mar 31 '17 at 10:56
1

Based on account subscriptions URL provided by @i4guar, the below code is how I am navigating to the Account Subscriptions page using Swift 4.2. This is working for me on iOS 14.5.

if let url = URL(string: "https://apps.apple.com/account/subscriptions") {
    if UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url, options: [:])
    }
}
JTODR
  • 318
  • 2
  • 10
0

If someone want to put the "Manage Subscriptions" button inner a long description text, as an option, we can just use UITextView's delegate to handle the NSURL interaction, it'll redirect user to App Store's subscription management view directly once user tap the "Manage Subscriptions" text.

Below is a sample code:

static NSString *const kURLOfManageSubscriptions = @"https://apps.apple.com/account/subscriptions";

- (void)setupSubviews
{
  UITextView *aTextView = [[UITextView alloc] init];
  aTextView.delegate = self;
  aTextView.editable = NO;
  aTextView.scrollEnabled = NO;
  // ...

  NSString *text = @"... long text contains ... Manage Subscriptions";
  UIFont *textFont = [UIFont systemFontOfSize:UIFont.systemFontSize];

  NSDictionary *textAttributes =
  @{NSFontAttributeName            : textFont,
    NSForegroundColorAttributeName : UIColor.labelColor
  };

  NSDictionary *linkedTextAttributes =
  @{NSFontAttributeName            : textFont,
    NSForegroundColorAttributeName : UIColor.blueColor,
    NSLinkAttributeName            : kURLOfManageSubscriptions
  };

  NSMutableAttributedString *content = [[NSMutableAttributedString alloc] initWithString:text attributes:textAttributes];
  NSRange linkedTextRange = [text rangeOfString:@"Manage Subscriptions"];
  [content addAttributes:linkedTextAttributes range:linkedTextRange];
  aTextView.attributedText = content;
}

#pragma mark - UITextViewDelegate

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction
{
  if ([URL.absoluteString isEqualToString:kURLOfManageSubscriptions]) {
    // The default interaction will redirect user to App Store's subscription
    //   management view directly.
    // Or you can manage it by yourself here.
    return YES;

  } else {
    return NO;
  }
}
Kjuly
  • 34,476
  • 22
  • 104
  • 118
0

In iOS15+ you can present the App Store sheet for managing subscriptions in your app by calling showManageSubscriptions(in:)

See here.

Kazunori Takaishi
  • 2,268
  • 1
  • 15
  • 27