Skip to content

Commit

Permalink
Update RevenueCat-Swift.h for version 5.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fire-at-will committed Nov 21, 2024
1 parent 9c7afc1 commit 0cba106
Showing 1 changed file with 116 additions and 8 deletions.
124 changes: 116 additions & 8 deletions Tests/InstallationTests/CommonFiles/RevenueCat-Swift.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
// Generated by Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
#ifndef REVENUECAT_SWIFT_H
#define REVENUECAT_SWIFT_H
#pragma clang diagnostic push
Expand Down Expand Up @@ -726,12 +726,12 @@ SWIFT_CLASS_NAMED("Builder")


@interface RCConfigurationBuilder (SWIFT_EXTENSION(RevenueCat))
- (RCConfigurationBuilder * _Nonnull)withUsesStoreKit2IfAvailable:(BOOL)usesStoreKit2IfAvailable SWIFT_WARN_UNUSED_RESULT SWIFT_DEPRECATED_MSG("Use .with(storeKitVersion:) to enable StoreKit 2");
- (RCConfigurationBuilder * _Nonnull)withObserverMode:(BOOL)observerMode SWIFT_WARN_UNUSED_RESULT SWIFT_AVAILABILITY(macos,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.") SWIFT_AVAILABILITY(watchos,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.") SWIFT_AVAILABILITY(tvos,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.") SWIFT_AVAILABILITY(ios,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.");
@end


@interface RCConfigurationBuilder (SWIFT_EXTENSION(RevenueCat))
- (RCConfigurationBuilder * _Nonnull)withObserverMode:(BOOL)observerMode SWIFT_WARN_UNUSED_RESULT SWIFT_AVAILABILITY(macos,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.") SWIFT_AVAILABILITY(watchos,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.") SWIFT_AVAILABILITY(tvos,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.") SWIFT_AVAILABILITY(ios,obsoleted=1,message="'with' has been renamed to 'withPurchasesAreCompletedBy:storeKitVersion:': Observer Mode is now named PurchasesAreCompletedBy.");
- (RCConfigurationBuilder * _Nonnull)withUsesStoreKit2IfAvailable:(BOOL)usesStoreKit2IfAvailable SWIFT_WARN_UNUSED_RESULT SWIFT_DEPRECATED_MSG("Use .with(storeKitVersion:) to enable StoreKit 2");
@end

/// Specifies the behavior for a caching API.
Expand Down Expand Up @@ -958,11 +958,11 @@ SWIFT_CLASS_NAMED("CustomerInfo")




@interface RCCustomerInfo (SWIFT_EXTENSION(RevenueCat))
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull rawData;
@end


@class RCStoreTransaction;

@interface RCCustomerInfo (SWIFT_EXTENSION(RevenueCat))
Expand Down Expand Up @@ -1864,6 +1864,56 @@ typedef SWIFT_ENUM_NAMED(NSInteger, RCPurchaseOwnershipType, "PurchaseOwnershipT
};


/// <code>PurchaseParams</code> can be used to add configuration options when making a purchase.
/// This class follows the builder pattern.
/// Example making a purchase using <code>PurchaseParams</code>:
/// \code
/// let params = PurchaseParams.Builder(package: package)
/// .with(metadata: ["key": "value"])
/// .with(promotionalOffer: promotionalOffer)
/// .build()
/// Purchases.shared.purchase(params)
///
/// \endcode
SWIFT_CLASS_NAMED("PurchaseParams")
@interface RCPurchaseParams : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

@class RCWinBackOffer;

/// The Builder for <code>PurchaseParams</code>.
SWIFT_CLASS_NAMED("Builder")
@interface RCPurchaseParamsBuilder : NSObject
/// Create a new builder with a <code>Package</code>.
/// \param package The <code>Package</code> the user intends to purchase.
///
- (nonnull instancetype)initWithPackage:(RCPackage * _Nonnull)package OBJC_DESIGNATED_INITIALIZER;
/// Create a new builder with a <code>StoreProduct</code>.
/// Use this initializer if you are not using the <code>Offerings</code> system to purchase a <code>StoreProduct</code>.
/// If you are using the <code>Offerings</code> system, use <code>PurchaseParams/Builder/init(package:)</code> instead.
/// \param product The <code>StoreProduct</code> the user intends to purchase.
///
- (nonnull instancetype)initWithProduct:(RCStoreProduct * _Nonnull)product OBJC_DESIGNATED_INITIALIZER;
/// Set <code>promotionalOffer</code>.
/// \param promotionalOffer The <code>PromotionalOffer</code> to apply to the purchase.
///
- (nonnull instancetype)withPromotionalOffer:(RCPromotionalOffer * _Nonnull)promotionalOffer SWIFT_WARN_UNUSED_RESULT;
/// Sets a win-back offer for the purchase.
/// Fetch a winBackOffer to use with this function with <code>Purchases/eligibleWinBackOffers(forProduct:)</code>
/// or <code>Purchases/eligibleWinBackOffers(forProduct:completion)</code>.
/// Availability: iOS 18.0+, macOS 15.0+, tvOS 18.0+, watchOS 11.0+, visionOS 2.0+
/// \param winBackOffer The <code>WinBackOffer</code> to apply to the purchase.
///
- (nonnull instancetype)withWinBackOffer:(RCWinBackOffer * _Nonnull)winBackOffer SWIFT_WARN_UNUSED_RESULT SWIFT_AVAILABILITY(visionos,introduced=2.0) SWIFT_AVAILABILITY(watchos,introduced=11.0) SWIFT_AVAILABILITY(tvos,introduced=18.0) SWIFT_AVAILABILITY(macos,introduced=15.0) SWIFT_AVAILABILITY(ios,introduced=18.0);
/// Generate a <code>Configuration</code> object given the values configured by this builder.
- (RCPurchaseParams * _Nonnull)build SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


SWIFT_CLASS_NAMED("PurchaserInfo") SWIFT_AVAILABILITY(macos,obsoleted=1,message="'PurchaserInfo' has been renamed to 'RCCustomerInfo'") SWIFT_AVAILABILITY(watchos,obsoleted=1,message="'PurchaserInfo' has been renamed to 'RCCustomerInfo'") SWIFT_AVAILABILITY(tvos,obsoleted=1,message="'PurchaserInfo' has been renamed to 'RCCustomerInfo'") SWIFT_AVAILABILITY(ios,obsoleted=1,message="'PurchaserInfo' has been renamed to 'RCCustomerInfo'")
@interface RCPurchaserInfo : NSObject
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
Expand Down Expand Up @@ -2166,6 +2216,40 @@ SWIFT_PROTOCOL_NAMED("PurchasesType")
/// A tuple with <code>StoreTransaction</code> and a <code>CustomerInfo</code> if the purchase was successful.
/// If the user cancelled the purchase, <code>userCancelled</code> will be <code>true</code>.
- (void)purchaseWithPackage:(RCPackage * _Nonnull)package completionHandler:(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, BOOL, NSError * _Nullable))completionHandler;
/// Initiates a purchase.
/// important:
/// Call this method when a user has decided to purchase a product.
/// Only call this in direct response to user input.
/// From here <code>Purchases</code> will handle the purchase with <code>StoreKit</code> and call the <code>PurchaseCompletedBlock</code>.
/// note:
/// You do not need to finish the transaction yourself in the completion callback, Purchases will
/// handle this for you.
/// If the purchase was successful there will be a <code>StoreTransaction</code> and a <code>CustomerInfo</code>.
/// If the purchase was not successful, there will be an <code>NSError</code>.
/// If the user cancelled, <code>userCancelled</code> will be <code>true</code>.
/// \param params The <code>PurchaseParams</code> instance with the configuration options for this purchase.
/// Check the <code>PurchaseParams</code> documentation for more information.
///
- (void)params:(RCPurchaseParams * _Nonnull)params withCompletion:(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, NSError * _Nullable, BOOL))completion;
/// Initiates a purchase.
/// important:
/// Call this method when a user has decided to purchase a product.
/// Only call this in direct response to user input.
/// From here <code>Purchases</code> will handle the purchase with <code>StoreKit</code> and return <code>PurchaseResultData</code>.
/// note:
/// You do not need to finish the transaction yourself after this, <code>Purchases</code> will
/// handle this for you.
/// \param params The <code>PurchaseParams</code> instance with extra configuration options for this purchase.
/// Check the <code>PurchaseParams</code> documentation for more information.
///
///
/// throws:
/// An error of type <code>ErrorCode</code> is thrown if a failure occurs while purchasing
///
/// returns:
/// A tuple with <code>StoreTransaction</code> and a <code>CustomerInfo</code> if the purchase was successful.
/// If the user cancelled the purchase, <code>userCancelled</code> will be <code>true</code>.
- (void)purchase:(RCPurchaseParams * _Nonnull)params completionHandler:(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, BOOL, NSError * _Nullable))completionHandler;
/// Invalidates the cache for customer information.
/// Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
/// Refer to
Expand Down Expand Up @@ -2454,6 +2538,15 @@ SWIFT_PROTOCOL_NAMED("PurchasesType")
/// \param product the product to filter discounts from.
///
- (void)eligiblePromotionalOffersForProduct:(RCStoreProduct * _Nonnull)product completionHandler:(void (^ _Nonnull)(NSArray<RCPromotionalOffer *> * _Nonnull))completionHandler;
/// Returns the win-back offers that the subscriber is eligible for on the provided product.
/// important:
/// Win-back offers are only supported when the SDK is running with StoreKit 2 enabled.
/// \param product The product to check for eligible win-back offers.
///
/// \param completion A completion block that is called with the eligible win-back
/// offers for the provided product.
///
- (void)eligibleWinBackOffersForProduct:(RCStoreProduct * _Nonnull)product completion:(void (^ _Nonnull)(NSArray<RCWinBackOffer *> * _Nullable, NSError * _Nullable))completion SWIFT_AVAILABILITY(visionos,introduced=2.0) SWIFT_AVAILABILITY(watchos,introduced=11.0) SWIFT_AVAILABILITY(tvos,introduced=18.0) SWIFT_AVAILABILITY(macos,introduced=15.0) SWIFT_AVAILABILITY(ios,introduced=18.0);
/// Displays a sheet that enables users to redeem subscription offer codes that you generated in App Store Connect.
/// important:
/// Even though the docs in <code>SKPaymentQueue.presentCodeRedemptionSheet</code>
Expand Down Expand Up @@ -2687,6 +2780,19 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _No



SWIFT_AVAILABILITY(visionos,introduced=2.0) SWIFT_AVAILABILITY(watchos,introduced=11.0) SWIFT_AVAILABILITY(tvos,introduced=18.0) SWIFT_AVAILABILITY(macos,introduced=15.0) SWIFT_AVAILABILITY(ios,introduced=18.0)
@interface RCPurchases (SWIFT_EXTENSION(RevenueCat))
/// Returns the win-back offers that the subscriber is eligible for on the provided product.
/// important:
/// Win-back offers are only supported when the SDK is running with StoreKit 2 enabled.
/// \param product The product to check for eligible win-back offers.
///
/// \param completion A completion block that is called with the eligible win-back
/// offers for the provided product.
///
- (void)eligibleWinBackOffersForProduct:(RCStoreProduct * _Nonnull)product completion:(void (^ _Nonnull)(NSArray<RCWinBackOffer *> * _Nullable, NSError * _Nullable))completion;
@end




Expand Down Expand Up @@ -3117,6 +3223,8 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class) BOOL automaticAppleSearchAdsAt
- (void)purchaseWithPackage:(RCPackage * _Nonnull)package completionHandler:(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, BOOL, NSError * _Nullable))completionHandler;
- (void)restorePurchasesWithCompletion:(void (^ _Nullable)(RCCustomerInfo * _Nullable, NSError * _Nullable))completion;
- (void)restorePurchasesWithCompletionHandler:(void (^ _Nonnull)(RCCustomerInfo * _Nullable, NSError * _Nullable))completionHandler;
- (void)params:(RCPurchaseParams * _Nonnull)params withCompletion:(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, NSError * _Nullable, BOOL))completion;
- (void)purchase:(RCPurchaseParams * _Nonnull)params completionHandler:(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, BOOL, NSError * _Nullable))completionHandler;
- (void)invalidateCustomerInfoCache;
- (void)syncPurchasesWithCompletion:(void (^ _Nullable)(RCCustomerInfo * _Nullable, NSError * _Nullable))completion;
- (void)syncPurchasesWithCompletionHandler:(void (^ _Nonnull)(RCCustomerInfo * _Nullable, NSError * _Nullable))completionHandler;
Expand Down Expand Up @@ -3223,7 +3331,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong, getter=defau
@end



@interface RCPurchasesDiagnostics (SWIFT_EXTENSION(RevenueCat))
/// Perform tests to ensure SDK is configured correctly.
/// <ul>
Expand All @@ -3237,6 +3344,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong, getter=defau




/// A type that can parse Apple receipts from a device.
/// This implements parsing based on <a href="https://rev.cat/apple-receipt-fields">Apple’s documentation</a>.
/// To use this class you must access <code>PurchasesReceiptParser/default</code>:
Expand Down Expand Up @@ -3730,13 +3838,13 @@ typedef SWIFT_ENUM_NAMED(NSInteger, RCSubscriptionPeriodUnit, "Unit", open) {


@interface RCSubscriptionPeriod (SWIFT_EXTENSION(RevenueCat))
@property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription;
/// The number of units per subscription period
@property (nonatomic, readonly) NSInteger numberOfUnits SWIFT_AVAILABILITY(macos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(watchos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(tvos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(ios,unavailable,message="'numberOfUnits' has been renamed to 'value'");
@end


@interface RCSubscriptionPeriod (SWIFT_EXTENSION(RevenueCat))
/// The number of units per subscription period
@property (nonatomic, readonly) NSInteger numberOfUnits SWIFT_AVAILABILITY(macos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(watchos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(tvos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(ios,unavailable,message="'numberOfUnits' has been renamed to 'value'");
@property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription;
@end


Expand Down

0 comments on commit 0cba106

Please sign in to comment.