mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-10 22:45:55 +05:45
Fixes SDK-3084  ## Changes: - Added new `ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION` compile time flag - Hidden `configureInCustomEntitlementsModeWithApiKey` behind `ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION` - Added new `RevenueCat_CustomEntitlementComputation` SPM target and library - Added CircleCI job for `swift build --target RevenueCat_CustomEntitlementComputation` - Added new `SPMCustomEntitlementComputationInstallation` using the new `configureInCustomEntitlementsComputationMode` - Added CircleCI job for `SPMCustomEntitlementComputationInstallation` - Added `FrameworkDisambiguation.swift` to avoid using `RevenueCat.` disambiguation for files that - Changed API testers to only use the new methods if `ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION` is defined - Updated `DangerousSettings` to not expose `customEntitlementComputation` publicly. The only way to use that now with `public` API is through `Purchases.configureInCustomEntitlementsModeWithApiKey` - Updated sample app to use new library
4.1 KiB
4.1 KiB
RevenueCat/Purchases
@Metadata { @DocumentationExtension(mergeBehavior: override) }
Purchases is the main entry point of the RevenueCat SDK.
It provides access to all its features.
Overview
The Purchases class can be used to access all the features of the RevenueCat SDK.
Most features require configuring the SDK before using it.
Topics
Interacting with the SDK
Purchases/sharedPurchases/isConfiguredPurchases/delegatePurchases/logLevelPurchases/logHandler
Configuring the SDK
Purchases/configure(withAPIKey:)Purchases/configure(with:)-6oipyPurchasesDiagnostics
Displaying Products
Purchases/offerings()Purchases/getOfferings(completion:)Purchases/products(_:)Purchases/getProducts(_:completion:)
Making Purchases
Purchases/purchase(package:)Purchases/purchase(package:completion:)Purchases/purchase(product:)Purchases/purchase(product:completion:)Purchases/simulatesAskToBuyInSandboxPurchases/canMakePayments()
Making Purchases with Subscription Offers
Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:)Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:completion:)Purchases/checkTrialOrIntroDiscountEligibility(product:)Purchases/checkTrialOrIntroDiscountEligibility(product:completion:)Purchases/promotionalOffer(forProductDiscount:product:)Purchases/getPromotionalOffer(forProductDiscount:product:completion:)Purchases/purchase(package:promotionalOffer:)Purchases/purchase(package:promotionalOffer:completion:)Purchases/purchase(product:promotionalOffer:)Purchases/purchase(product:promotionalOffer:completion:)Purchases/presentCodeRedemptionSheet()
Subscription Status
Purchases/getCustomerInfo(completion:)Purchases/customerInfo(fetchPolicy:)Purchases/customerInfoStream
Identifying Users
Purchases/appUserIDPurchases/isAnonymousPurchases/logIn(_:)-arjaPurchases/logIn(_:completion:)-4km90Purchases/logOut()Purchases/logOut(completion:)
Managing Subscriptions
Purchases/syncPurchases()Purchases/syncPurchases(completion:)Purchases/restorePurchases()Purchases/restorePurchases(completion:)Purchases/beginRefundRequestForActiveEntitlement()Purchases/beginRefundRequest(forEntitlement:)Purchases/beginRefundRequest(forProduct:)Purchases/showManageSubscriptions()Purchases/showManageSubscriptions(completion:)
Parsing Receipts
PurchasesReceiptParserAppleReceipt
Subscriber Attributes
Purchases/setAttributes(_:)Purchases/setAd(_:)Purchases/setEmail(_:)Purchases/setDisplayName(_:)Purchases/setKeyword(_:)Purchases/setCampaign(_:)Purchases/setCreative(_:)Purchases/setAdGroup(_:)Purchases/setPushToken(_:)Purchases/setPushTokenString(_:)Purchases/setMediaSource(_:)Purchases/setPhoneNumber(_:)Purchases/collectDeviceIdentifiers()
Integrations
Purchases/setAdjustID(_:)Purchases/setAirshipChannelID(_:)Purchases/setAppsflyerID(_:)Purchases/setCleverTapID(_:)Purchases/setFBAnonymousID(_:)Purchases/setFirebaseAppInstanceID(_:)Purchases/setMixpanelDistinctID(_:)Purchases/setMparticleID(_:)Purchases/setOnesignalID(_:)
Advanced Configuration
Purchases/finishTransactionsPurchases/invalidateCustomerInfoCache()Purchases/forceUniversalAppStorePurchases/proxyURLPurchases/verboseLogsPurchases/verboseLogHandlerPurchases/allowSharingAppStoreAccount
Configuring the SDK with parameters (deprecated)
Purchases/configure(withAPIKey:appUserID:)Purchases/configure(withAPIKey:appUserID:observerMode:)Purchases/configure(withAPIKey:appUserID:observerMode:userDefaults:)Purchases/configure(withAPIKey:appUserID:observerMode:userDefaults:useStoreKit2IfAvailable:)