Skip to content

Commit

Permalink
Revert "move rest of deprecations to deprecations.swift"
Browse files Browse the repository at this point in the history
This reverts commit 47ecfff.
  • Loading branch information
Maddie Beyl committed Apr 25, 2022
1 parent d51c37f commit f2014f8
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 60 deletions.
58 changes: 0 additions & 58 deletions Sources/Misc/Deprecations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,64 +62,6 @@ public extension Purchases {
@available(*, deprecated, message: "Use Purchases.automaticAdServicesAttributionTokenCollection instead")
@objc static var automaticAppleSearchAdsAttributionCollection: Bool = false

/**
* Enable debug logging. Useful for debugging issues with the lovely team @RevenueCat.
*/
@available(*, deprecated, message: "use Purchases.logLevel instead")
@objc static var debugLogsEnabled: Bool {
get { logLevel == .debug }
set { logLevel = newValue ? .debug : .info }
}

/**
* Deprecated
*/
@available(*, deprecated, message: "Configure behavior through the RevenueCat dashboard instead")
@objc var allowSharingAppStoreAccount: Bool {
get { purchasesOrchestrator.allowSharingAppStoreAccount }
set { purchasesOrchestrator.allowSharingAppStoreAccount = newValue }
}

/**
* Send your attribution data to RevenueCat so you can track the revenue generated by your different campaigns.
*
* - Parameter data: Dictionary provided by the network.
* - Parameter network: Enum for the network the data is coming from, see ``AttributionNetwork`` for supported
* networks.
*
* #### Related articles
* - [Attribution](https://docs.revenuecat.com/docs/attribution)
*/
@available(*, deprecated, message: "Use the set<NetworkId> functions instead")
@objc static func addAttributionData(_ data: [String: Any], fromNetwork network: AttributionNetwork) {
addAttributionData(data, from: network, forNetworkUserId: nil)
}

/**
* Send your attribution data to RevenueCat so you can track the revenue generated by your different campaigns.
*
* - Parameter data: Dictionary provided by the network.
* - Parameter network: Enum for the network the data is coming from, see ``AttributionNetwork`` for supported
* networks.
* - Parameter networkUserId: User Id that should be sent to the network. Default is the current App User Id.
*
* #### Related articles
* - [Attribution](https://docs.revenuecat.com/docs/attribution)
*/
@available(*, deprecated, message: "Use the set<NetworkId> functions instead")
@objc(addAttributionData:fromNetwork:forNetworkUserId:)
static func addAttributionData(_ data: [String: Any],
from network: AttributionNetwork,
forNetworkUserId networkUserId: String?) {
if Self.isConfigured {
shared.post(attributionData: data, fromNetwork: network, forNetworkUserId: networkUserId)
} else {
AttributionPoster.store(postponedAttributionData: data,
fromNetwork: network,
forNetworkUserId: networkUserId)
}
}

}

public extension StoreProduct {
Expand Down
68 changes: 66 additions & 2 deletions Sources/Purchasing/Purchases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public typealias StartPurchaseBlock = (@escaping PurchaseCompletedBlock) -> Void
private let productsManager: ProductsManager
private let customerInfoManager: CustomerInfoManager
private let trialOrIntroPriceEligibilityChecker: TrialOrIntroPriceEligibilityChecker
internal let purchasesOrchestrator: PurchasesOrchestrator
private let purchasesOrchestrator: PurchasesOrchestrator
private let receiptFetcher: ReceiptFetcher
private let requestFetcher: StoreKitRequestFetcher
private let storeKitWrapper: StoreKitWrapper
Expand Down Expand Up @@ -751,7 +751,7 @@ extension Purchases {
// MARK: Attribution.
extension Purchases {

internal func post(attributionData data: [String: Any],
private func post(attributionData data: [String: Any],
fromNetwork network: AttributionNetwork,
forNetworkUserId networkUserId: String?) {
attributionPoster.post(attributionData: data, fromNetwork: network, networkUserId: networkUserId)
Expand Down Expand Up @@ -1870,6 +1870,70 @@ extension Purchases: PurchasesOrchestratorDelegate {

}

// MARK: Deprecated

public extension Purchases {

/**
* Enable debug logging. Useful for debugging issues with the lovely team @RevenueCat.
*/
@available(*, deprecated, message: "use Purchases.logLevel instead")
@objc static var debugLogsEnabled: Bool {
get { logLevel == .debug }
set { logLevel = newValue ? .debug : .info }
}

/**
* Deprecated
*/
@available(*, deprecated, message: "Configure behavior through the RevenueCat dashboard instead")
@objc var allowSharingAppStoreAccount: Bool {
get { purchasesOrchestrator.allowSharingAppStoreAccount }
set { purchasesOrchestrator.allowSharingAppStoreAccount = newValue }
}

/**
* Send your attribution data to RevenueCat so you can track the revenue generated by your different campaigns.
*
* - Parameter data: Dictionary provided by the network.
* - Parameter network: Enum for the network the data is coming from, see ``AttributionNetwork`` for supported
* networks.
*
* #### Related articles
* - [Attribution](https://docs.revenuecat.com/docs/attribution)
*/
@available(*, deprecated, message: "Use the set<NetworkId> functions instead")
@objc static func addAttributionData(_ data: [String: Any], fromNetwork network: AttributionNetwork) {
addAttributionData(data, from: network, forNetworkUserId: nil)
}

/**
* Send your attribution data to RevenueCat so you can track the revenue generated by your different campaigns.
*
* - Parameter data: Dictionary provided by the network.
* - Parameter network: Enum for the network the data is coming from, see ``AttributionNetwork`` for supported
* networks.
* - Parameter networkUserId: User Id that should be sent to the network. Default is the current App User Id.
*
* #### Related articles
* - [Attribution](https://docs.revenuecat.com/docs/attribution)
*/
@available(*, deprecated, message: "Use the set<NetworkId> functions instead")
@objc(addAttributionData:fromNetwork:forNetworkUserId:)
static func addAttributionData(_ data: [String: Any],
from network: AttributionNetwork,
forNetworkUserId networkUserId: String?) {
if Self.isConfigured {
shared.post(attributionData: data, fromNetwork: network, forNetworkUserId: networkUserId)
} else {
AttributionPoster.store(postponedAttributionData: data,
fromNetwork: network,
forNetworkUserId: networkUserId)
}
}

}

// MARK: Internal
internal extension Purchases {

Expand Down

0 comments on commit f2014f8

Please sign in to comment.