Every June, Apple holds an annual developer conference where it announces the next iOS version and updates to the frameworks.
This year, Apple introduced iOS 16 and some major updates, like Lock Screen widgets, animations, and more. However, we are mostly interested in updates to in-app purchases and related APIs.
Last year we talked about StoreKit 2 which is significantly different from traditional StoreKit. Today, Apple added some more features to this framework.
This class should be mostly used to get the original purchase date of your paid app. It is also useful when you switch from a paid to a freemium business model. In this case you would want to maintain premium access to users who purchased a paid app as well as those who subscribed in a freemium app version.
In the original StoreKit, it is the same as the JSON receipt's originalPurchaseDate
field.
In Apphud SDK, you can fetch raw receipt with the same info like this:
Apphud.fetchRawReceiptInfo { receipt in guard let date = receipt?.originalPurchaseDate else { return } ... }
The new method lets you defer a StoreKit message sheet, for example, a price increase consent screen. Nothing really interesting here.
There are two minor new methods to present an offer code redemption sheet and request an App Store review within your app.
Two minor properties were added to StoreKit 2. Nothing special.
environment
- whether the subscription was purchased in a sandbox or production environment. This property already exists in legacy receipt, so this is not an important update to Apphud.
recentSubscriptionStartDate
- documentation says that it is the earliest start date of a subscription that ignores all lapses shorter than 60 days. And if there is no 60 days gap — the recentSubscriptionStartDate
will be the same as the originalPurchaseDate
. Simply speaking, this is the date of subscription reactivation.
There are a few enhancements for in-app purchases testing in Xcode.
You will be able to sync your App Store Connect products to Xcode, which seems to be a pretty cool feature. Would be great if that worked vice-versa, i.e. Products created in Xcode appeared in App Store Connect.
More test cases have been added to Local StoreKit testing, like offer code redemptions, refund requests, and so on. This is a nice improvement, but not commonly used across app developers.
Fortunately, Apphud does support purchases made in iOS Simulator using StoreKit configuration file:
Apple says that developers will be able to create sandbox users and test sandbox purchases much easier. Looks really interesting, since creating a new sandbox user is annoying – it requires you to log in to ASC. What will it look like? We will update you shortly.
A TEST
notification type has been added, which lets you confirm that your server is ready to receive notifications. Google Play Console already has this feature in its Real-Time Notifications.
Apple continues to improve App Store Server API by adding some new endpoints, like getting notifications history, sort and filter options, and provides an API for requesting a test notification.
Currently, Apphud does not currently support Notifications V2 for the following reasons:
base64
receipt. Once notification has arrived, Apphud operates with the included receipt, but not with the notification name.Apple added an API for requesting a test notification:
POST https://api.storekit.itunes.apple.com/inApps/v1/notifications/test
Google Play has a button in its console for requesting a test notification which seems more convenient to me.
You can get the history of notifications which can be helpful to restore updates in case of your server outage:
POST https://api.storekit.itunes.apple.com/inApps/v1/notifications/history
If your server is down for a long period of time, all notifications retry attempts may fail, and the only way to retrieve notifications will be via this new API.
Apple added sort and filter options to their "get notifications history" endpoint. Okay, but not exciting.
Apple added some enhancements to their APIs and frameworks, but actually nothing breakthrough.
The only thing we are excited about is syncing App Store Connect products to Xcode. At Apphud we handle all subscription updates for you so you don’t have to worry about implementing Server Notifications V2.
We will continue to update you with the new frameworks and improvements at WWDC 2022. Stay tuned!