Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do apps tie accounts with in-app purchase subscription?

Tags:

I'm working on an iOS app where a user must sign up/sign in to an account for my app. To be able to use my services I want users to pay via in-app purchases (auto-renewing in my case). This would then tie their IAP to their account (they created with us) to be able to use on any other iOS device.

Case 1: For example if a subscription was bought on phone A for an account, when signing on to phone B (using the same account) shouldn't make the user pay again.

Case 2: Or if a subscription was bought for account A on a phone, when signing up for account B on the same phone should make the user pay for account B.

Basically I want an in-app purchase to tie to my account (rather than a apple device/Apple account which is how it works to my understanding.)

I understand that their are receipts which is probably part of the answer to my question. Or if this a limitation to in app purchases what other ways can this be done (other than using Apple's IAP)

like image 384
Matt Bart Avatar asked Aug 06 '18 17:08

Matt Bart


People also ask

Do in-app purchases transfer between devices?

If you have made an in-app purchase then these should automatically show up with Android devices, however, if you made in-app purchases on an iOS device you will need to visit the shop to restore your purchases.

Do in-app purchases transfer between Family Sharing?

You can't share in-app purchases and apps downloaded at no charge with your family members.

Does Apple take a percentage of in-app subscriptions?

Apple's standard IAP revenue distribution is 70% dev, 30% Apple - note that is 85%/15% for certain annual subscriptions. IAP cannot be used for physical merchandise.

How are in-app purchases paid for?

Creating an account on the app store requires putting a credit or debit card on file, to cover any costs associated with downloading paid apps. Because apps are downloaded through those platforms, the app companies can charge the card associated with the account directly, making in-app purchases easy and intuitive.


1 Answers

The answer to the title of the question:

When a purchase is made there is an update received in the app, the next time it is launched which contains a transaction_id (original_transaction_id for renewals), you should associate this transaction id with your app user id.

Case 1: Apple provides an option to "Restore Purchases" in your app. Since, the same account is used, your app servers would already know that a user has already paid and the app shouldn't prompt the user to pay again. However, in order to receive the upcoming renewal updates on phone B, you must "Restore Purchases" which would let Apple link the previous purchase on this device as well. Once the restore is done, the users purchase receipt will be available on the device and all subsequent actions should be taken based on the content validation of the receipt.

Few points here:

  1. Apple will reject your app, if it doesn't provide this option to the user.
  2. Even if your app is buggy, and you failed to restore purchases, user wouldn't be charged again. The purchase would fail saying you already have purchased this.

The above case is completely based on the assumption that the user is using the same Apple Id on both the devices(same application user id doesn't matter).

Case 2: I am not sure if that is anyhow possible. Since it's the same device, the user uses the same AppleId(unless he signs out and changes apple id in App Store) and Apple will restrict the repurchase. At best you may restrict the account B with the subscription content but if your application allows multiple accounts on the same device use case(e.g Instagram), I am not sure if there's a provision for the same.

I tested the same scenario for a music service app I use. Have an active subscription, logged out and signed up with other email (app), but the purchase was denied alerting I have already purchased. However, it was allowing me upgrade and downgrade options. I didn't opt for testing them so not to mess up my account.

Here's the screenshot

P.S: There are a lot of other caveats/gotchas to take care of. Some of them:

  1. In case 2, apple restricts the repurchase but it doesn't restrict if the user chooses an option other than the current active subscription, which will upgrade/ downgrade the subscription. Based on how you have implemented things, it might even change the subscription for user A immediately or next time the user logs back in or on next renewal thereafter.
  2. In both the cases discussed here, user uses the same Apple Id, but consider the cases - same Apple Id different app id AND different Apple Id and same app Id. (See this)
  3. For case 2, you should always refresh receipts or restore purchases(if there's no receipt available) for a fresh user login. The receipt has a original transaction id which you should have linked the first time the purchase was made with user A. Based on the receipt, you can either choose to let user B access the content or restrict. However, you cannot let the user pay for the new account(I suppose so).

Helpful Links:

Restoring Purchases

Receipt Validation

like image 198
mickeymoon Avatar answered Sep 28 '22 17:09

mickeymoon