Skip to content

Commit

Permalink
StoreKit 2: added warning to paywall constructors (#3045)
Browse files Browse the repository at this point in the history
This became a requirement with #3032.
  • Loading branch information
NachoSoto authored Aug 22, 2023
1 parent ea411c0 commit 93b09a2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Sources/Support/PaywallExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 93b09a2

Please sign in to comment.