From 0dcd33f93f5f33311a6e1fcdb15bd1f070c8b04b Mon Sep 17 00:00:00 2001 From: Pavel Tikhonenko Date: Tue, 25 May 2021 17:25:07 +0300 Subject: [PATCH] Fix compilation issues --- Sources/Extras.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Sources/Extras.swift b/Sources/Extras.swift index 747d49f..c71deff 100644 --- a/Sources/Extras.swift +++ b/Sources/Extras.swift @@ -14,6 +14,8 @@ import StoreKit @available(watchOSApplicationExtension 6.2, *) fileprivate var refreshSession: RefreshSession? +@available(tvOS 12.0, *) +@available(macOS 10.14, *) @available(iOS 12.0, *) public class SKSubscriptionGroup { @@ -28,7 +30,12 @@ public class SKSubscriptionGroup init(with products: Set) { - self.identifier = products.first?.subscriptionGroupIdentifier ?? "" + guard let gid = products.first?.subscriptionGroupIdentifier else + { + fatalError("All products must have subscriptionGroupIdentifier") + } + + self.identifier = gid self.products = products } @@ -50,7 +57,9 @@ public class SKSubscriptionGroup public typealias GroupIdentifier = String +@available(tvOS 12.0, *) @available(iOS 12.0, *) +@available(macOS 10.14, *) public extension SKProductsResponse { /// Build a `SKSubscriptionGroup` object @@ -118,6 +127,8 @@ public extension SKProductsResponse } } +@available(tvOS 12.0, *) +@available(macOS 10.14, *) public extension InAppReceipt {