How do you handle auto-renewable subscriptions in apps that have a non-Apple account system?

Viewed 249

I am working on an app that provides users with the ability to sign in and out using accounts on my service. I also want to provide users with the ability to purchase auto-renewable subscriptions.

I can't figure out how to enable users to sign in and out using accounts on my service and purchase auto-renewable subscriptions. This is because StoreKit purchases are tied to the device's logged in Apple ID, and cannot be tied to accounts on my system.

For example, suppose:

  • A person has an iPhone and is signed in to iOS on that device using their Apple ID: bob@icloud.com
  • This person downloads my app, and creates userA in my account system.
  • As userA, they buy an auto-renewable subscription. This purchase is stored on the StoreKit receipt for user bob@icloud.com.
  • Without changing Apple IDs, the person signs out my app and creates userB on my system.
  • The person tries to buy the same auto-renewable subscription for userB. When they do this nothing happens. Specifically, this code:
SKMutablePayment *payment = [SKMutablePayment paymentWithProduct:[self.products objectForKey:identifier]];
//...
[[SKPaymentQueue defaultQueue] addPayment:payment];

does not prompt userB to purchase, because as far as StoreKit is concerned, they already own it, because they are still bob@icloud.com on the device.

Even if I store subscription information on my servers (which I do), I'm not sure how I can remedy the situation except for allowing only Apple Sign In on the iOS version of my app. This is because Apple Sign In is strictly tied to the current Apple ID on the device.

Is this really the only way to have users in an app that also has IAP auto-renewable subscriptions? I've searched the web and it seems like that's the case.

1 Answers

IF I understand, what you want to do is:

• on YOUR system there are TWO users, A and B

• in reality, A and B are the same person. (Call her "Jane".)

• in fact Jane has (obviously) the same iPhone, whether she is your-system-A or your-system-B. Let's refer to that iPhone as iPhone 7778636728637

• you are offering a subscription named "dragon-eggs-renewable"

So:

When 7778636728637 wants to buy "dragon-eggs-renewable",

you want to be able to sell her

• "dragon-eggs-renewable" for A

AND sell her

• "dragon-eggs-renewable" for B

That is totally impossible.

The subscription "dragon-eggs-renewable" goes only by the phone.

Sign-on-with-Apple is unrelated. †

Subscriptions go by the phone and that's it.

But there is a way around this:

The trick is. Have say three subscriptions named,

  • "dragon-eggs-renewable"
  • "dragon-eggs-renewable-supp1"
  • "dragon-eggs-renewable-supp2"

In your system, if they are user A, sell them "dragon-eggs-renewable".

However, if you realize they are user B, sell them "dragon-eggs-renewable-supp1"

You see what I mean?

It's not at all unusual to sell more than one subscription. (Example "powerup1" ... "powerup2" ... etc)

Hope it works, and hope I understood!

Unless there is something new in late 2020 regarding sign-on-with-Apple, the above is the situation!

Related