My app offers in-app subscriptions. When a subscription is bought or renewed, the app is notified with a SKPaymentTransaction, that contains in-app product identifier. I can query that in-app id to retrieve the purchased SKProduct. That product may contain a regular price, an introductory price (or trial), and one or more discount prices (since iOS 12.2). In case of a renewed subscription, the current regular price may differ from the price the user had been subscribed in the past.
My question is how to tell which is the price the user has paid:
current regular price;
introductory price/trial;
discount price;
something else, available in the past for that user.
You can't get the actual price of the transaction directly, but you can look at the product price and some other receipt fields to approximate what the user paid.
You'll need to save the price and introductoryPrice from the SKProduct then you can look at the is_in_intro_offer_period flag on the SKPaymentTransaction to determine if the price field or introductoryPrice is what the user will be charged.
Note that the SKProduct prices will be in the user's currency so you should be saving the locale too if you want to convert everything to the same currency.
The fact that price is not in a receipt still blows my mind :)
Related
I have a paid app on apple store, I wish to migrate to IAP, if use .*.IAP as productID for IAP, I can check transactions against this for purchase status, but for those original paid up, can I get a receipt, if so what productID do I check against?
Or should I get user to subscribe to non consumable purchase at £0.00 and at a later date, after trial period, switch store price to £0.00 and IAP price to £x.xx
Thanks
My new app has certain features that require auto-renewing subscriptions. I set up my subscription and set its pricing on AppStore Connect.
I also want to offer a promotional offer which discounts the monthly subscription fee. I also set this up on AppStore Connect.
When I test the app on my iPhone, the subscription prices comes up at full price and not discounted promotional price.
Is there anything special I need to do for promotional price to apply? Do I need to use "Introductory Offers" instead? I thought "Promotional Offer" was the right one for me because it applies to all new users for a set period. The introductory offers seem to have a set start/end dates.
We have "try for free" button in our app. I'd like to figure out how to know that trial is available.
I'm a little bit doubt about following text from documentation:
New and resubscribing customers are eligible to pay one discounted price or free trial per subscription group.
What is "resubscribing"? Can customers who has subscription in the past have trial again?
Is it possible to use StoreKit to figure out that trial is available now?
Is it correct to check introductoryPrice property of the SKProduct: https://developer.apple.com/documentation/storekit/skproduct/2936878-introductoryprice?
I also had an idea to ask backend for all the subscription history for current user and show "try for free" if user didn't have trial yet. But as I said I'm not sure about that "resubscribing".
The correct way to check for trial eligibility is to validate the receipt file as outlined by Apple below. Since most would consider this a non-critical validation, there isn't much harm in doing it client-side instead of off a server to save a network call. The worst harm a fake receipt could do is change the text of your button.
Determine Eligibility
To determine if a user is eligible for an introductory price, check
their receipt: Validate the receipt as described in Validating
Receipts With the App Store. In the receipt, check the values of the
Subscription Trial Period and the Subscription Introductory Price
Period for all in-app purchase transactions. If either of these fields
are true for a given subscription, the user is not eligible for an
introductory price on that subscription product or any other products
within the same subscription group. You typically check the user's
eligibility from your server. It's best to determine eligibility
early—for example, on the first launch of the app, if possible.
Based on the receipt, you will find that new and returning customers
are eligible for introductory price or free trial discounts as
follows: New subscribers are always eligible. Lapsed subscribers who
renew are eligible if they haven't previously received an introductory
price for the given product (or any product within the same
subscription group).
To answer your specific questions:
Can customers who has subscription in the past have trial again?
No. This is enforced by Apple for any products in the same subscription group. For example if user starts a trial for "Monthly Product", cancels, then later buys "Yearly Product" they won't be eligible for a free trial.
Is it possible to use StoreKit to figure out that trial is available
now? Is it correct to check introductoryPrice property of the
SKProduct?
No. The SKProduct will always show the same introductory price.
I have In-app purchase in my application but now I want to apply the backend manageable coupon codes to be applied on the subscription.
For example if I apply a coupon code the amount should be reduced and effective amount should be less then current; Suppose a 10% coupon code on USD$1000, the price to USD$900.
The problem is amount is linked to the product and charged by Apple.
How can I do this?
You can't use coupon codes to decrease the price of an in-app purchase.
For auto renewing subscription IAPs you can offer introductory pricing.
You could also use a coupon code to unlock visibility of a different in-app product in your app that is charged at a lower price, but if it is a subscription then that lower price would be charged ongoing.
Perhaps you could try combining the two; The coupon code makes a subscription with an introductory price available. Without the coupon code the user only sees the subscription without the introductory price.
You can create two in app purchases in appstore connect
for example if your purchase is called fun pack
then you can have a purchase called fun pack in app store connect priced at 9.99 and have another fun pack priced for 7.99
so if your user uses a coupon then you should call the purchase method so that it purchases the 7.99$ iAP . if they purchase it without a coupon then just purchase the 9.99$ pack. I hope this makes sense
You can use an SKPRoductRequest to get prices for products, and you can use the App Store receipt API to get what products a user has purchased (as of iOS7).
However, I think the SKProductRequest reflects the current price for the products.
Is there any way to tell what price the user actually paid for an in-app purchase, given there might have been a price change? How about for the app itself?
You will have to store the purchase price on the device or server, or in your analytics package