Skip to content

Commit

Permalink
Added 16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisharper22 committed May 31, 2023
1 parent 7dff035 commit d3e564b
Show file tree
Hide file tree
Showing 7,534 changed files with 2,661,975 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//
// SKAdTestPostback.h
// StoreKitTest
//
// Copyright © 2021 Apple Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
#import <StoreKit/StoreKitDefines.h>

NS_ASSUME_NONNULL_BEGIN

typedef NSString * SKAdTestPostbackVersion NS_TYPED_ENUM API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos);

SK_EXTERN SKAdTestPostbackVersion const SKAdTestPostbackVersion2_1 API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos);
SK_EXTERN SKAdTestPostbackVersion const SKAdTestPostbackVersion2_2 API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos);
SK_EXTERN SKAdTestPostbackVersion const SKAdTestPostbackVersion3_0 API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos);

SK_EXTERN_CLASS API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos) @interface SKAdTestPostback : NSObject

/// Use this initializer to create a postback with the specified version and parameters.
/// Parameters that are not applicable to the specified version will be ignored.
/// Parameters that are mandatory for the specified version and not provided will result
/// in failure to create the postback.
-(nullable instancetype)initWithVersion:(SKAdTestPostbackVersion)version adNetworkIdentifier:(NSString *)adNetworkIdentifier adCampaignIdentifier:(NSInteger)adCampaignIdentifier appStoreItemIdentifier:(NSInteger)appStoreItemIdentifier sourceAppStoreItemIdentifier:(NSInteger)sourceAppStoreItemIdentifier conversionValue:(NSInteger)conversionValue fidelityType:(NSInteger)fidelityType isRedownload:(BOOL)isRedownload didWin:(BOOL)didWin postbackURL:(NSString *)postbackURL API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos);

- (instancetype)init NS_UNAVAILABLE;

+ (instancetype)new NS_UNAVAILABLE;

/// The version of SKAdNetwork being used.
@property (nonatomic, strong, readonly) SKAdTestPostbackVersion version;

/// The identifier for the ad network.
@property (nonatomic, strong, readonly) NSString *adNetworkIdentifier;

/// The ad campaign identifier.
@property (nonatomic, assign, readonly) NSInteger adCampaignIdentifier;

/// The App Store item identifier for the app.
@property (nonatomic, assign, readonly) NSInteger appStoreItemIdentifier;

/// The App Store item identifier for the source app.
@property (nonatomic, assign, readonly) NSInteger sourceAppStoreItemIdentifier;

/// The conversion value for this conversion.
@property (nonatomic, assign, readonly) NSInteger conversionValue;

/// A flag indicating whether this postback is registered or not.
@property (nonatomic, assign, readonly) BOOL isRegistered;

/// The transaction identifier for this postback.
@property (nonatomic, strong, readonly) NSString * transactionIdentifier;

/// The fidelity-type for this conversion.
@property (nonatomic, assign) NSInteger fidelityType;

/// Indication as to whether this conversion was for a redownload
@property (nonatomic, assign, readonly) BOOL isRedownload;

/// Indication as to whether this was the winning conversion
@property (nonatomic, assign, readonly) BOOL didWin;

/// The URL to which the postback is to be sent.
@property (nonatomic, strong, readonly) NSString *postbackURL;

@end

SK_EXTERN_CLASS API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos, tvos) __TVOS_PROHIBITED @interface SKAdTestPostbackResponse : NSObject

/// The error encountered, if any, while attempting to send this postback.
@property (nonatomic, strong, nullable) NSError *error;

/// A boolean flag indicating if this postback was sent successfully.
@property (nonatomic, assign) BOOL didSucceed;

/// The HTTP response received, if any, as a result of sending the postback.
@property (nonatomic, strong, nullable) NSHTTPURLResponse *httpResponse;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// SKAdTestSession.h
// StoreKitTest
//
// Copyright © 2021 Apple Inc. All rights reserved.
//

#import <StoreKit/StoreKit.h>

@class SKAdTestPostback;
@class SKAdTestPostbackResponse;

NS_ASSUME_NONNULL_BEGIN

typedef void (^SKANTestPostbackResponseHandler)(NSDictionary <NSString *, SKAdTestPostbackResponse *> * __nullable responseDict, NSError * __nullable error) API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

SK_EXTERN_CLASS API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,tvos,watchos)
@interface SKAdTestSession : NSObject

#pragma mark - Methods

- (instancetype)init;

/// Use this method to validate an impression against the requirements that SKAdNetwork impressions
/// are expected to satisfy. This method is to be used for StoreKit rendered ads.
- (BOOL)validateImpressionWithParameters:(NSDictionary <NSString *, id> *)parameters publicKey:(NSString *)publicKey error:(NSError *__autoreleasing _Nullable *)error NS_SWIFT_NAME(validateImpression(parameters:publicKey:)) API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

/// Use this method to validate an impression against the requirements that SKAdNetwork impressions
/// are expected to satisfy. This method is to be used for ViewThrough ads.
- (BOOL)validateImpression:(SKAdImpression *)impression publicKey:(NSString *)publicKey error:(NSError *__autoreleasing _Nullable *)error API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

/// Use this method to set postbacks to interact with later.
- (BOOL)setPostbacks:(NSArray <SKAdTestPostback *> *)postbacks error:(NSError *__autoreleasing _Nullable *)error NS_SWIFT_NAME(setPostbacks(_:)) API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

@property (nonatomic, strong, readonly) NSArray <SKAdTestPostback *> * postbacks;

@property (nonatomic, strong, readonly, nullable) NSURL *developerPostbackURL;

/// Use this method to send the test postbacks.
- (void)flushPostbacksWithResponses:(SKANTestPostbackResponseHandler)responses NS_SWIFT_ASYNC(1) API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// SKTestError.h
// StoreKitTest
//
// Copyright © 2020 Apple Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKitDefines.h>

NS_ASSUME_NONNULL_BEGIN

SK_EXTERN NSErrorDomain const SKTestErrorDomain API_AVAILABLE(ios(14.0), macos(11.0), tvos(14.0), watchos(7.0));

SK_EXTERN NSErrorDomain const SKAdTestErrorDomain API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

typedef NS_ERROR_ENUM(SKTestErrorDomain, SKTestErrorCode) {
SKTestErrorCodeServiceUnavailable = 0,
SKTestErrorCodeInvalidProductIdentifier = 1,
SKTestErrorCodeInvalidProductType = 2,
SKTestErrorCodeInvalidURL = 3,
SKTestErrorCodeFileNotFound = 4,
SKTestErrorCodeNoSubscriptionFound = 5,
SKTestErrorCodeNoTransactionFound = 6,
SKTestErrorCodeInvalidAction = 7
} API_AVAILABLE(ios(14.0), macos(11.0), tvos(14.0), watchos(7.0));

typedef NS_ERROR_ENUM(SKAdTestErrorDomain, SKAdTestErrorCode) {
SKAdTestErrorCodeSignatureMissingAdNetworkId = 0,
SKAdTestErrorCodeSignatureMissingCampaignId = 1,
SKAdTestErrorCodeSignatureMissingAppAdamId = 2,
SKAdTestErrorCodeSignatureMissingNonce = 3,
SKAdTestErrorCodeSignatureMissingSourceAppAdamId = 4,
SKAdTestErrorCodeSignatureMissingFidelityType = 5,
SKAdTestErrorCodeSignatureMissingTimestamp = 6,
SKAdTestErrorCodeSignatureVerificationFailed = 7,
SKAdTestErrorCodeSignatureInvalidKey = 8,
SKAdTestErrorCodeSignatureInvalidOrder = 9,
SKAdTestErrorCodeSignatureUnknownError = 10,
SKAdTestErrorCodeMisplacedWinnerPostback = 11,
SKAdTestErrorCodeInvalidRunnerUpPostback = 12,
SKAdTestErrorCodeInvalidConversionValue = 13,
SKAdTestErrorCodeMissingWinningPostback = 14,
SKAdTestErrorCodeMissingPostbacks = 15,
SKAdTestErrorCodeMalformedPostbacks = 16,
SKAdTestErrorCodeExcessivePostbacks = 17,
SKAdTestErrorCodeNoPendingPostbacks = 18,
SKAdTestErrorCodeInvalidPostbackURL = 19,
SKAdTestErrorCodeMissingSignature = 20,
SKAdTestErrorCodeUnknownError = 21
} API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos,watchos) __TVOS_PROHIBITED;

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
//
// SKTestSession.h
// StoreKitTest
//
// Copyright © 2020 Apple Inc. All rights reserved.
//

#import <StoreKit/StoreKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, SKTestTimeRate) {
SKTestTimeRateRealTime,

SKTestTimeRateOneHourIsOneDay API_DEPRECATED("Use real time or a time rate in terms of monthly renewals", ios(14.0, 15.2), macos(11.0, 12.1), tvos(14.0, 15.2), watchos(7.0, 8.3)),
SKTestTimeRateThirtyMinutesIsOneDay API_DEPRECATED("Use real time or a time rate in terms of monthly renewals", ios(14.0, 15.2), macos(11.0, 12.1), tvos(14.0, 15.2), watchos(7.0, 8.3)),
SKTestTimeRateFiveMinutesIsOneDay API_DEPRECATED("Use real time or a time rate in terms of monthly renewals", ios(14.0, 15.2), macos(11.0, 12.1), tvos(14.0, 15.2), watchos(7.0, 8.3)),
SKTestTimeRateOneMinuteIsOneDay API_DEPRECATED_WITH_REPLACEMENT("SKTestTimeRateMonthlyRenewalEveryThirtyMinutes", ios(14.0, 15.2), macos(11.0, 12.1), tvos(14.0, 15.2), watchos(7.0, 8.3)),
SKTestTimeRateThirtySecondsIsOneDay API_DEPRECATED_WITH_REPLACEMENT("SKTestTimeRateMonthlyRenewalEveryFifteenMinutes", ios(14.0, 15.2), macos(11.0, 12.1), tvos(14.0, 15.2), watchos(7.0, 8.3)),
SKTestTimeRateOneSecondIsOneDay API_DEPRECATED_WITH_REPLACEMENT("SKTestTimeRateMonthlyRenewalEveryThirtySeconds", ios(14.0, 15.2), macos(11.0, 12.1), tvos(14.0, 15.2), watchos(7.0, 8.3)),

SKTestTimeRateMonthlyRenewalEveryHour API_AVAILABLE(ios(15.2), macos(12.1), tvos(15.2), watchos(8.3)) = 10,
SKTestTimeRateMonthlyRenewalEveryThirtyMinutes API_AVAILABLE(ios(15.2), macos(12.1), tvos(15.2), watchos(8.3)),
SKTestTimeRateMonthlyRenewalEveryFifteenMinutes API_AVAILABLE(ios(15.2), macos(12.1), tvos(15.2), watchos(8.3)),
SKTestTimeRateMonthlyRenewalEveryFiveMinutes API_AVAILABLE(ios(15.2), macos(12.1), tvos(15.2), watchos(8.3)),
SKTestTimeRateMonthlyRenewalEveryThirtySeconds API_AVAILABLE(ios(15.2), macos(12.1), tvos(15.2), watchos(8.3)) = 15,
} NS_SWIFT_NAME(SKTestSession.TimeRate) API_AVAILABLE(ios(14.0), macos(11.0), tvos(14.0), watchos(7.0));

@class SKTestTransaction;

SK_EXTERN_CLASS API_AVAILABLE(ios(14.0), macos(11.0), tvos(14.0), watchos(7.0)) NS_SWIFT_SENDABLE
@interface SKTestSession : NSObject


#pragma mark - Properties

// Default to NO
@property (nonatomic, assign) BOOL askToBuyEnabled;

// Default to NO
@property (nonatomic, assign) BOOL disableDialogs;

// Default to NO
@property (nonatomic, assign) BOOL failTransactionsEnabled;

// Default to NO
@property (nonatomic, assign) BOOL interruptedPurchasesEnabled;

/// While this property is enabled, subscription renewals will fail due to billing issues, and enter a simulated
/// billing retry state.
///
/// Default to NO.
@property (nonatomic, assign) BOOL billingRetryOnRenewalEnabled API_AVAILABLE(ios(15.4), macos(12.3), tvos(15.4), watchos(8.5)) NS_SWIFT_NAME(shouldEnterBillingRetryOnRenewal);

/// Enable this property to test allowing a grace period when subscriptions enter a billing retry state.
///
/// Default to NO. The value of this property has no effect while billingRetryOnRenewalEnabled is NO.
@property (nonatomic, assign) BOOL billingGracePeriodEnabled API_AVAILABLE(ios(15.4), macos(12.3), tvos(15.4), watchos(8.5)) NS_SWIFT_NAME(billingGracePeriodIsEnabled);

/*
Requires shouldFailTransactions to be set to YES
Valid values are:
SKErrorUnknown
SKErrorInvalidOfferIdentifier
SKErrorInvalidSignature
SKErrorMissingOfferParams
SKErrorInvalidOfferPrice
*/
@property (nonatomic, assign) SKErrorCode failureError;

// ISO 3166-1 Alpha-3 country code representation, default to USA
@property (nonatomic, copy) NSString *storefront;

// Default to en_US
@property (nonatomic, copy) NSLocale *locale;

// Default to SKTestTimeRateRealTime
@property (nonatomic, assign) SKTestTimeRate timeRate;


#pragma mark - Methods

// The filename needs to reference a .storekit file that is included in your application's bundle
- (nullable instancetype)initWithConfigurationFileNamed:(NSString *)filename error:(NSError **)error;

// The URL needs to be a file URL to a .storekit file
- (nullable instancetype)initWithContentsOfURL:(NSURL *)fileURL error:(NSError **)error NS_DESIGNATED_INITIALIZER;

- (instancetype)init NS_UNAVAILABLE;

+ (instancetype)new NS_UNAVAILABLE;

- (NSArray<SKTestTransaction *> *)allTransactions;

- (void)clearTransactions;

- (BOOL)deleteTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(deleteTransaction(identifier:));

- (BOOL)expireSubscriptionWithProductIdentifier:(NSString *)productIdentifier error:(NSError **)error NS_SWIFT_NAME(expireSubscription(productIdentifier:));

- (BOOL)forceRenewalOfSubscriptionWithProductIdentifier:(NSString *)productIdentifier error:(NSError **)error NS_SWIFT_NAME(forceRenewalOfSubscription(productIdentifier:));

- (BOOL)refundTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(refundTransaction(identifier:));

/// Use this method to resolve a transaction that has a purchase issue.
///
/// Transactions will have issues if a purchase is made when interruptedPurchasesEnabled is YES, or if a
/// subscription renews when billingRetryOnRenewalEnabled is YES. The billing retry state is temporary, if a
/// transaction has exited the billing retry state then this method will have no effect.
- (BOOL)resolveIssueForTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(resolveIssueForTransaction(identifier:));

// Removes all property overrides and resets everything back to the default state
- (void)resetToDefaultState;


#pragma mark - Ask to Buy

- (BOOL)approveAskToBuyTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(approveAskToBuyTransaction(identifier:));

- (BOOL)declineAskToBuyTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(declineAskToBuyTransaction(identifier:));

#pragma mark - Auto-Renew

- (BOOL)disableAutoRenewForTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(disableAutoRenewForTransaction(identifier:));

- (BOOL)enableAutoRenewForTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error NS_SWIFT_NAME(enableAutoRenewForTransaction(identifier:));

#pragma mark - Price Increase

/// Use this method to test a price increase for a transaction, requiring subscriber consent to continue renewing.
- (BOOL)requestPriceIncreaseConsentForTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error API_AVAILABLE(ios(15.4), macos(12.3), tvos(15.4), watchos(8.5)) NS_SWIFT_NAME(requestPriceIncreaseConsentForTransaction(identifier:));

/// Use this method on transactions that require price increase consent to consent to the price increase and
/// continue renewing.
- (BOOL)consentToPriceIncreaseForTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error API_AVAILABLE(ios(15.4), macos(12.3), tvos(15.4), watchos(8.5)) NS_SWIFT_NAME(consentToPriceIncreaseForTransaction(identifier:));

/// Use this method on transactions that require price increase consent to disable autorenewing due to a
/// declined price increase.
- (BOOL)declinePriceIncreaseForTransactionWithIdentifier:(NSUInteger)identifier error:(NSError **)error API_AVAILABLE(ios(15.4), macos(12.3), tvos(15.4), watchos(8.5)) NS_SWIFT_NAME(declinePriceIncreaseForTransaction(identifier:));

#pragma mark - External Transactions

- (BOOL)buyProductWithIdentifier:(NSString *)productIdentifier error:(NSError **)error NS_SWIFT_NAME(buyProduct(productIdentifier:));

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// SKTestTransaction.h
// StoreKitTest
//
// Copyright © 2020 Apple Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>

NS_ASSUME_NONNULL_BEGIN

SK_EXTERN_CLASS API_AVAILABLE(ios(14.0), macos(11.0), tvos(14.0), watchos(7.0)) NS_SWIFT_SENDABLE
@interface SKTestTransaction : NSObject

@property(nonatomic, readonly) BOOL autoRenewingEnabled;

@property(nonatomic, readonly, nullable) NSDate *cancelDate;

@property(nonatomic, readonly, nullable) NSDate *expirationDate;

@property(nonatomic, readonly) BOOL hasPurchaseIssue;

@property(nonatomic, readonly) NSUInteger identifier;

@property(nonatomic, readonly) NSUInteger originalTransactionIdentifier;

@property(nonatomic, readonly) BOOL pendingAskToBuyConfirmation;

@property(nonatomic, readonly) NSString *productIdentifier;

@property(nonatomic, readonly) NSDate *purchaseDate;

@property(nonatomic, readonly) SKPaymentTransactionState state;

@property(nonatomic, readonly) BOOL pendingPriceIncreaseConsent API_AVAILABLE(ios(15.4), macos(12.3), tvos(15.4), watchos(8.5)) NS_SWIFT_NAME(isPendingPriceIncreaseConsent);

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// StoreKitTest.h
// StoreKitTest
//
// Copyright © 2020 Apple Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <StoreKitTest/SKAdTestSession.h>
#import <StoreKitTest/SKAdTestPostback.h>
#import <StoreKitTest/SKTestError.h>
#import <StoreKitTest/SKTestSession.h>
#import <StoreKitTest/SKTestTransaction.h>

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
framework module StoreKitTest [extern_c] {
umbrella header "StoreKitTest.h"

export *
module * { export * }
}

Loading

0 comments on commit d3e564b

Please sign in to comment.