Files
purchases-ios/Tests/APITesters/AllAPITests/CustomEntitlementComputationSwiftAPITester/CustomerInfoAPI.swift
T
Andy Boedo facc6907d5 Clean up API Testers (#4141)
# API Testers cleanup

- Moves all API Testers into main RevenueCat workspace
- ensure that they all use the local build, not a hardcoded commit
- kill all the separate projects, create a single project with a
framework per test (objc api tests, swift api tests, etc, etc)
- creates a single scheme that builds all of those targets in one pass
- update relevant CI (to do)

Here's what this actually looks like: a single scheme in Xcode, which
you can test using command + U (or just build, since it effectively
works too)

<img width="515" alt="Screenshot 2024-07-31 at 6 09 33 PM"
src="https://github.com/user-attachments/assets/53882e38-f34b-4878-a11e-5d9c304e57ec">

<img width="278" alt="Screenshot 2024-07-31 at 6 09 44 PM"
src="https://github.com/user-attachments/assets/3a7a444c-36da-4c82-ab57-4aeab77adb5d">

*Note:*
Okay, I'd directly recommend _not_ reviewing the diff, since it's kind
of insane, and instead checking out the branch to see if things make
sense.
2024-08-05 11:11:49 -03:00

61 lines
2.1 KiB
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// CustomerInfoAPI.swift
//
// Created by Madeline Beyl on 8/25/21.
import Foundation
import RevenueCat_CustomEntitlementComputation
var customerInfo: CustomerInfo!
func checkCustomerInfoAPI() {
let entitlementInfo: EntitlementInfos = customerInfo.entitlements
let asubs: Set<String> = customerInfo.activeSubscriptions
let appis: Set<String> = customerInfo.allPurchasedProductIdentifiers
let led: Date? = customerInfo.latestExpirationDate
let nst: [NonSubscriptionTransaction] = customerInfo.nonSubscriptions
let oav: String? = customerInfo.originalApplicationVersion
let opd: Date? = customerInfo.originalPurchaseDate
let rDate: Date? = customerInfo.requestDate
let fSeen: Date = customerInfo.firstSeen
let oaud: String? = customerInfo.originalAppUserId
let murl: URL? = customerInfo.managementURL
let edfpi: Date? = customerInfo.expirationDate(forProductIdentifier: "")
let pdfpi: Date? = customerInfo.purchaseDate(forProductIdentifier: "")
let exdf: Date? = customerInfo.expirationDate(forEntitlement: "")
let pdfe: Date? = customerInfo.purchaseDate(forEntitlement: "")
let desc: String = customerInfo.description
let rawData: [String: Any] = customerInfo.rawData
print(customerInfo!, entitlementInfo, asubs, appis, led!, nst, oav!, opd!, rDate!, fSeen,
oaud!, murl!, edfpi!, pdfpi!, exdf!, pdfe!, desc, rawData)
}
func checkCacheFetchPolicyEnum(_ policy: CacheFetchPolicy) {
switch policy {
case .fromCacheOnly: break
case .fetchCurrent: break
case .cachedOrFetched: break
case .notStaleCachedOrFetched: break
@unknown default: break
}
}
@available(*, deprecated) // Ignore deprecation warnings
func checkDeprecatedAPI() {
let _: Set<String> = customerInfo.nonConsumablePurchases
let _: [StoreTransaction] = customerInfo.nonSubscriptionTransactions
}