mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
When using StoreKit Config file, we do not have access to the transaction history or subscription status server-side. To work around this, we introduce a new `StoreKit2Receipt` type that closely resembles the structure of an SK1 receipt and contains all the transaction history and subscription status for the customer. It can be sent in a single request to `/receipt` --------- Co-authored-by: RevenueCat Git Bot <72824662+RCGitBot@users.noreply.github.com> Co-authored-by: Distiller <distiller@static.38.39.183.137.cyberlynk.net> Co-authored-by: Distiller <distiller@static.38.23.40.89.cyberlynk.net> Co-authored-by: Distiller <distiller@static.38.39.185.65.cyberlynk.net> Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
34 lines
1.0 KiB
Swift
34 lines
1.0 KiB
Swift
//
|
|
// Copyright RevenueCat Inc. All Rights Reserved.
|
|
//
|
|
// Licensed under the MIT License (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://opensource.org/licenses/MIT
|
|
//
|
|
// SK2AppTransaction.swift
|
|
//
|
|
// Created by MarkVillacampa on 26/10/23.
|
|
|
|
import StoreKit
|
|
|
|
/// A wrapper for `StoreKit.AppTransaction`.
|
|
@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *)
|
|
internal struct SK2AppTransaction {
|
|
|
|
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
|
|
init(appTransaction: AppTransaction) {
|
|
self.bundleId = appTransaction.bundleID
|
|
self.originalApplicationVersion = appTransaction.originalAppVersion
|
|
self.originalPurchaseDate = appTransaction.originalPurchaseDate
|
|
self.environment = .init(environment: appTransaction.environment)
|
|
}
|
|
|
|
let bundleId: String
|
|
let originalApplicationVersion: String?
|
|
let originalPurchaseDate: Date?
|
|
let environment: StoreEnvironment?
|
|
|
|
}
|