From 93b09a27a3f990d747f4bf062cbcd110bb5b7d53 Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Tue, 22 Aug 2023 15:38:30 -0700 Subject: [PATCH] `StoreKit 2`: added warning to paywall constructors (#3045) This became a requirement with #3032. --- Sources/Support/PaywallExtensions.swift | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Sources/Support/PaywallExtensions.swift b/Sources/Support/PaywallExtensions.swift index 13a222f541..be49ce0d38 100644 --- a/Sources/Support/PaywallExtensions.swift +++ b/Sources/Support/PaywallExtensions.swift @@ -24,7 +24,10 @@ extension StoreView { /// Creates a view to load a collection of products from the App Store, and merchandise them using an /// icon and custom placeholder icon. /// When the user purchases products through this paywall, the `RevenueCat` SDK will handle - /// the result automatically. All you need to do is to dismiss the paywall + /// the result automatically. All you need to do is to dismiss the paywall. + /// + /// - Warning: In order to use StoreKit paywalls you must configure the `RevenueCat` SDK + /// in SK2 mode using ``Configuration/Builder/with(usesStoreKit2IfAvailable:)``. public static func forOffering( _ offering: Offering, prefersPromotionalIcon: Bool = false, @@ -48,7 +51,10 @@ extension StoreView where Icon == EmptyView, PlaceholderIcon == EmptyView { /// Creates a view to load a collection of products from the App Store, and merchandise them. /// When the user purchases products through this paywall, the `RevenueCat` SDK will handle - /// the result automatically. All you need to do is to dismiss the paywall + /// the result automatically. All you need to do is to dismiss the paywall. + /// + /// - Warning: In order to use StoreKit paywalls you must configure the `RevenueCat` SDK + /// in SK2 mode using ``Configuration/Builder/with(usesStoreKit2IfAvailable:)``. public static func forOffering( _ offering: Offering, prefersPromotionalIcon: Bool = false @@ -70,7 +76,10 @@ extension SubscriptionStoreView { /// Creates a ``SubscriptionStoreView`` from an ``Offering`` /// with custom marketing content. /// When the user purchases products through this paywall, the `RevenueCat` SDK will handle - /// the result automatically. All you need to do is to dismiss the paywall + /// the result automatically. All you need to do is to dismiss the paywall. + /// + /// - Warning: In order to use StoreKit paywalls you must configure the `RevenueCat` SDK + /// in SK2 mode using ``Configuration/Builder/with(usesStoreKit2IfAvailable:)``. public static func forOffering( _ offering: Offering, @ViewBuilder marketingContent: () -> (Content) @@ -90,6 +99,9 @@ extension SubscriptionStoreView where Content == AutomaticSubscriptionStoreMarke /// Creates a ``SubscriptionStoreView`` from an ``Offering`` /// that doesn't take a custom view to use for marketing content. + /// + /// - Warning: In order to use StoreKit paywalls you must configure the `RevenueCat` SDK + /// in SK2 mode using ``Configuration/Builder/with(usesStoreKit2IfAvailable:)``. public static func forOffering(_ offering: Offering) -> some View { return self .init(productIDs: offering.subscriptionProductIdentifiers)