How to correctly display the introductory price of an iOS SKProduct?
Asked Answered
R

0

7

Short version:

  • created an introductory price for a subscription in itunes connect
  • the new price is set to start in about a month
  • all clients receive the new price information when updating their SKProducts right away

How to ensure that the new price is displayed in my UI only WHEN the introductory price is available?

Detailed version:

Put simply, the Apple documentation on the topic of offering introductory prices through an iOS app are as follows:

  • check for eligibility by parsing the current store receipt and looking for old purchases of a subscription group where the values isInIntroOfferPeriod or isTrialPeriod are set to true. If so, the user will not receive the current introductory price since he/she received an introductory price at some point in the past already

  • after updating your SKProducts, see if the introductoryPrice value is set. If so, offer reflect the discount in your app (if of course the user is eligible)

My problem however is this: I have created an introductory price in itunes connect, and set its "start date" to about a month into the future. Based on Apples guide on "how to offer introductory prices", one would think that the introductoryPrice is not nil/null when a client updates their SKProducts during the time the discount is offered and nil/null when there is no discount available. In reality the SKProduct contains an introductoryPrice object with the new price, duration and so on, for every client updating their SKProducts as soon as the introductory price is created. Even though it's not available until a month into the future. This would lead to my app displaying the new price as there is no way to distinguish wether or not the discount is active or not.

I'd ideally not want to hard code a date into the app before which I disregard the introductory price. Is there something I am not seeing? How have you solved the problem?

Rivarivage answered 25/10, 2018 at 7:33 Comment(6)
HI,i suggest you to read this developer.apple.com/documentation/storekit/skproduct/…Makhachkala
Thanks for the comment but that doesn't contain any more information. For more reading on the topic there is: developer.apple.com/documentation/storekit/in-app_purchase/… . However, the problem is that the introductory price as is described there, is immediately populated even if it's start date is far into the future.Rivarivage
Have you had any luck in getting a consistent behavior with future start date introductory prices? I have done same thing for one subscription in my app, with same result: introductoryPrice parameter is immediately not nil. I'm also confused about introductory price deletion, as the parameter is also still present.Sheep
@Sheep Sadly no. To have the maximum flexibility we decided to only activate introductory prices immediately (Unlike for test purchases where it is immediately, it took the app 4-5 hours until they retrieved the introductory price of a real and ready for sale purchase.) Also please don't make the same mistake I did and test your app on iOS 11. iOS 11 has a bug that will cause your app to crash if you access the introductoryPrice.locale attribute in Swift.Rivarivage
This behaviour occurs in the sandbox, but also in production?Wiliness
I'd like to second @StéphanedeLuca question. Is the introductory price available right away only for sandbox or is it same for production. That would make absolutely no sense. Why give us the ability to schedule promotions with dates if the dates are ignored.Gian

© 2022 - 2024 — McMap. All rights reserved.