Files
purchases-ios/Tests/APITesters/AllAPITests/CustomEntitlementComputationSwiftAPITester/StorefrontAPI.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

31 lines
814 B
Swift

//
// StorefrontAPI.swift
// SwiftAPITester
//
// Created by Nacho Soto on 4/13/22.
//
import RevenueCat_CustomEntitlementComputation
import StoreKit
var storefront: RevenueCat_CustomEntitlementComputation.Storefront!
func checkStorefrontAPI() {
let identifier: String = storefront.identifier
let countryCode: String = storefront.countryCode
let sk1Storefront: SKStorefront? = storefront.sk1Storefront
if #available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) {
let sk2Storefront: StoreKit.Storefront? = storefront.sk2Storefront
print(sk2Storefront!)
}
_ = Task<Void, Never> {
let _: RevenueCat_CustomEntitlementComputation.Storefront? = await Storefront.currentStorefront
}
print(identifier,
countryCode,
sk1Storefront!)
}