Commit Graph
108 Commits
Author SHA1 Message Date
Pol Piella Abadia 3bf9fa9576 Uses the remote version of purchases-ios for the SwiftUI sample app (#4841)
* Uses the remote version of `purchases-ios` for the sample app

* Removes framework reference to fix build failure

* Removes workspace

* Resets `Package.resolved` to fix compiler errors

* Re-adds missing dependency

* Updates `README.md`
2025-03-03 16:28:49 +00:00
Facundo Menzella 6b5c430082 chore: Enable force_unwrapping for SwiftLint (#4820)
* enable force_unwrapping

* avoid force unwrap

* fixed all errors

* remove extra disable
2025-02-26 12:40:49 +01:00
nyeu 499ebe6b18 Feat/update swift sample apps (#4337)
* Bump SDK version, min deployment target and remove deprecated files

* Show a targeted paywall in WeatherVC and a default one in UserVC

* Update README with new features and requirements
2024-10-07 11:58:57 +02:00
NachoSoto 2bcd0ce328 5.0.0 changes: support SK2 by default 2024-07-01 14:37:21 -05:00
NachoSoto 761ca1209d New TestStoreProduct for creating mock StoreProducts and Offerings (#2711)
Fixes #1563 and #2193.

This introduces **`DEBUG` and `Swift` only** types that allow creating a
whole `Offering` for tests and SwiftUI previews.

Example:
![Screenshot 2023-06-26 at 12 36
40](https://github.com/RevenueCat/purchases-ios/assets/685609/03d83e65-b95b-40ba-80ad-f8be435c6d3e)

By making it available in only `DEBUG` builds we ensure that apps can't
accidentally try to purchase these products, which would be impossible.
If this is attempted in `DEBUG` builds, we return `ErrorCode`.

When trying to compile this API in release builds, you get an error with
a suggestion:

![image](https://github.com/RevenueCat/purchases-ios/assets/685609/f83b8848-dab6-4ae6-a92d-5c07a30be217)
2023-06-29 14:06:24 -07:00
NachoSoto 442b683cfe Added .xcprivacy for Xcode 15 (#2619)
Example generated report:

![Screenshot 2023-06-09 at 15 16
11](https://github.com/RevenueCat/purchases-ios/assets/685609/5b4265d5-4102-4938-9efa-1915678fc635)
2023-06-14 12:22:35 -07:00
NachoSoto d65ebbba2a Custom Entitlement Computation: added missing scheme to project (#2579) 2023-06-05 08:01:31 -07:00
Andy Boedo 9abf17227c updated example code for the sample app for Custom Entitlements (#2454)
Updated example code based on latest usage
2023-04-27 14:10:08 -03:00
NachoSotoandToni Rico 4a74d33f84 Custom Entitlement Computation: disabled unnecessary APIs (#2442)
## Disabled API:

- `getCustomerInfo`
- `logIn`
- `logOut`
- `Purchases.attribution`
- `syncPurchases`
- `restorePurchases`
- Trial eligibility
- Promotional purchases
- `async` counterparts

---------

Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
2023-04-26 14:51:40 -03:00
NachoSoto d65caf72b3 Custom Entitlement Computation: avoid getCustomerInfo requests for cancelled purchases (#2449)
Fixes SDK-3088
Supersedes #2447

Thanks to @tonidero for doing most of this.

Note that it's currently impossible to test this for SK2, so we only
have SK1 tests (we have a Radar for that).

The next step will be to deprecate the current API to remove the
`userCancelled` property and make this the new behavior.
See also #1910 for an explanation of the different return values of the
purchase APIs.
2023-04-26 09:53:22 -07:00
Andy Boedo f7ef9f3a80 customEntitlementsComputation: update the copy in the sample app to explain the new usage (#2443)
Updated the copy in the sample app to explain the new usage
2023-04-25 23:23:18 -07:00
NachoSoto 64c8638425 Create separate SPM library to enable custom entitlement computation (#2440)
Fixes SDK-3084

![screenshot_2023-04-25_at_10 02
44_480](https://user-images.githubusercontent.com/685609/234360670-bd2628a1-0684-490d-a9eb-33846a60f72a.png)

## 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
2023-04-25 15:11:58 -07:00
Andy BoedoandNachoSoto 618ff121d2 Custom Entitlements Computation mode (#2439)
### Changes:

- Added `Purchases.configureInCustomEntitlementsComputationMode`
- Added `Purchases.switchUser(to:)`
- Disabled parts of the SDK in this new mode
- New example app for testing `customEntitlementsComputation` mode

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
2023-04-25 13:21:46 -07:00
Joseph Kokenge b91dd19c92 SwiftUI Sample Project: Refactor Package terms method to a computed property (#2405)
Note: Not sure if PRs are wanted on Example code.

### Checklist
- [x] If applicable, unit tests
- [ ] If applicable, create follow-up issues for `purchases-android` and
hybrids

### Motivation
Noticed that the terms func was just passing the same `package`.

### Description
Testing: Looks like there are no tests for sample code.

This pull request refactors the terms(for package: Package) method in
the Package extension to a computed property terms. The change not only
improves readability and simplifies access to the package terms, but
also eliminates the need to pass a Package instance to a function that
belongs to the same Package type, which didn't make sense.
By making these changes, we provide a more streamlined and intuitive
approach for developers to access package terms, and eliminate the need
for an explicit method call.
2023-04-13 09:43:10 -03:00
ConfusedVorlon 3cc302bc83 PurchaseTester: PaywallView should respond to changes on the UserView model (#2297)
I hit this bug when I first tried the example. My offerings loaded
slowly - so the paywall was empty, and didn't update when the offerings
were retrieved.

### Description
App stores current state in the shared `UserViewModel`, but the
`PaywallView` doesn't currently observe changes on this model - so it only
shows the state at the point where the view was shown.
This is potentially a state where offerings have not yet been retrieved.
2023-02-19 18:43:09 -08:00
NachoSoto 9313659efc MagicWeatherSwiftUI: updated README to point to workspace (#2142) 2022-12-20 07:30:14 -08:00
rglanz-rc 39746c7e2a README updates (#1856)
* README updates

Main README and MagicWeather README updated to be consistent with docs in purchases-android repository.

* Removed trello link in Features table

Removed the last link in the Features table, which led to a private/broken trello page.

* Updated Xcode min version and min iOS target

Updated Xcode minimum version from 10.2 to 13.2.
Updated minimum iOS target from 9.0 to 11.0.

* Updated minimum targets with additional devices

Updated the minimum targets under the Requirements section to include iOS (11.0+), tvOS (11.0+), macOS (10.13+), and watchOS (6.2+).
2022-08-19 16:13:38 -05:00
Joshua Liebowitz babc06fa84 Update package requirements (#1852)
pull in up to next major, fix build issue
2022-08-18 10:26:57 -07:00
NachoSoto 8806f9df4b MagicWeatherSwiftUI: updated to use async APIs (#1843) 2022-08-17 10:28:24 -07:00
NachoSoto ee2a56165f Added pre-commit hook to ensure API keys aren't committed (#1756)
Fixes [CSDK-273].
2022-07-25 11:56:59 -07:00
NachoSoto ea6d662c03 [skip ci] MagicWeatherSwiftUI: updated to use async API (#1620) 2022-05-26 13:57:25 -07:00
NachoSoto b15255a433 [skip ci] MagicWeather: updated initialization to use new Configuration.Builder (#1619) 2022-05-26 13:20:05 -07:00
NachoSoto 59d4ef8500 MagicWeatherSwiftUI: fixed usage of PurchaseDelegate (#1601)
This was changed in #1460. Additionally, without #1600 this wasn't producing the correct rename, it wasn't finding `DeferredPromotionalPurchaseBlock` anywhere.
2022-05-24 10:09:36 -07:00
NachoSoto 48cb268f17 MagicWeatherSwiftUI: implemented purchases(:shouldPurchasePromoProduct:defermentBlock:) (#1459)
Also added example link from https://stackoverflow.com/a/68386112/401024
2022-04-06 13:19:12 -07:00
NachoSoto 174cdd29e8 MagicWeatherSwiftUI: increased deployment target to iOS 15.0 (#1448)
Not sure why this worked when I added it in #1218, but this `alert` initializer is now only available on iOS 15.0
2022-04-05 11:08:44 -07:00
aboedo 04f765b2e7 Move purchase tester to tests folder (#1415)
* moved TestingApps into Tests folder

* update podfile
2022-03-25 13:51:21 -03:00
aboedo efb6bcd8be Rename IntegrationTests -> InstallationTests (#1396)
* temporarily enable tests for all branches to test out the changes

* carthageIntegration -> carthageInstallation

* cocoapodsIntegration -> cocoapodsInstallation

* fixed cocoapods integration tests

* RCIntegrationRunner -> RCInstallationRunner

* IntegrationTests -> InstallationTests

* removed extra file

* more folder name updates

* spm_integration -> spm_installation

* XcodeDirectIntegration -> XcodeDirectInstallation

* split items into InstallationTests and TestingApps

* clean up remaining references

* more reference fixes

* even more reference fixes

* removed TestingApps from swiftlint

* reverted bundleID update in XcodeDirectIntegration

* reverted bundleID update in CarthageIntegration

* reverted bundleID update in CocoapodsIntegration

* reverted bundleID update in SPMIntegration

* more reference updates in fastfile

* update package.swift

* fix bridging header path

* remove cartfile.resolved

* renamed a couple of remaining bridging headers

* disabled installation tests for non-release branches

* fixes from PR comments

* renamed flag XCODE_INTEGRATION -> XCODE_INSTALLATION
2022-03-18 09:47:17 -03:00
NachoSoto 81c1398f14 [skip-ci] MagicWeatherSwiftUI: removed reference to SubscriptionPeriod.Unit.unknown (#1319)
Was removed in #1235.
2022-02-19 10:16:46 -07:00
NachoSoto d5ee1543c6 [skip-ci] MagicWeatherSwiftUI: removed redundant Package: Identifiable conformance (#1318)
Already exposed by #1268.
2022-02-19 10:16:37 -07:00
NachoSoto 86dea871ac Re-enabled SK2 (#1213)
Fixes [sc-9602]
2022-01-31 11:22:12 -08:00
NachoSoto 774cc0dee9 MagicWeatherSwiftUI: display error when purchase fails (#1218)
Very simple and crude UI, but it's something. Currently the error was only logged to the console.
2022-01-25 15:38:32 -08:00
aboedo b1a84e5311 Replace LegacySwiftExample with symlink to PurchaseTester (#1195)
* removed legacy swift example

* added symlink to PurchaseTester in LegacySwiftExample
2022-01-20 11:22:53 -03:00
aboedo 1cde8c29b0 updated API calls in MagicWeatherSwiftUI (#1192) 2022-01-19 17:38:47 -03:00
aboedo 1039fc04b5 update MagicWeather API calls to latest syntax (#1189)
* updated a few API calls in MagicWeather

* cleaned up a couple of docs, cleaned up `localizedIntroductoryPriceString` usage in magicWeather
2022-01-19 17:36:00 -03:00
Josh Holtz 9447e09394 Rename all Configuration.storekit files with RevenueCat specific names (#1157)
* Rename all Configuration.storekit files with RevenueCat specific names

* Fix reference from backend tests

* Nope but maybe this will fix it

* Hopefully this
2022-01-11 07:43:11 -06:00
NachoSoto f0b6ba6402 MagicWeatherSwiftUI improvements (#1115) 2021-12-29 09:37:04 -08:00
NachoSoto eb2ea68ad8 WeatherSwiftUI: use contentShape to allow tapping on the whole cell (#1082)
Without this, it seems like tapping on the `PackageCellView` sometimes doesn't do anything.
2021-12-15 15:43:18 -08:00
NachoSoto b1a3160537 MagicWeatherSwiftUI: use StoreKit 2 (#1074)
This is a test app, so I think it makes sense to have it use the latest APIs.
2021-12-14 09:55:45 -08:00
NachoSoto e4e49a9bd6 MagicWeatherSwiftUI: fixes for new V4 StoreProduct API (#1072) 2021-12-13 13:21:43 -08:00
NachoSoto d9d8c58858 Updated Package.resolved (#997)
I keep getting Xcode automatically updating these 2. Looks like for 2 reasons:
- #946 got rid of SPM on the MagicWeatherProject
- The dependency got updated
2021-11-29 16:55:23 -08:00
aboedo cad10d8769 Storekit 2: update deployment targets (#977)
* updated deployment targets in Package.swift

* updated deployment targets in Podspec

* updated deployment targets in xcode project

* updated deployment target in cocoapods integration tests

* updated deployment target in SPM integration tests

* Added note in the v4_api_updates doc to document the new OS requirements

* reverted os version for watchOS back to "6.2" since it seems like `v6_2` doesn't work
2021-11-22 13:04:19 -03:00
c4d43ffdec Storekit 2: milestone 1 (#953)
* Sk2: fetch products, make purchases (#800)

* added product struct

* added Product protocol and separated wrappers for sk1 and sk2

* added price and localizedPriceString to Product

* added bridging code and first call to generic productsWithIdentifiers

* a lot of cleanup, added a couple more properties for products

* added subscription group id and cleaned up a bit

* Updated productsManager so it forwards the products calls to fetchers for sk1 and sk2

* updated a few tests and API availability checks

* updated a few methods to use productwrapper instead of skproduct

* updated tests in many places and apis

* fixed rebase issues

* fixed a few todos

* fixed a few issues caught by swiftlint

* fixed rebase issues and some visibility issues

* updated a few places to use SK2

* added horrifyingly hacky implementation for purchasing with sk2

* small cleanup, re-added method for getting SKProducts directly

* cleanup

* added caching to sk2 products fetcher

* removed trailing whitespace

* slight cleanup

* added more clarifying comments

* another cleanup

* added missing availability marks for macOS

* fixed availability marks for ProductsFetcher in ProductsManager

* yet another fix for macOS availability checks

* and more fixes for macOS version since 13.0 doesn't exist

* fixed issues in api tester

* fixed pod lib lint on non-arch64 architectures

* bundle update fastlane

* added test for dictionary += operator

* removed unnecessary method for fetching product wrappers

* cleanup file names

* updated references in StoreKitTests

* fixed targets for test file

* fixed rebase issues

* added StoreKit 2 transaction listener in the hopes of getting purchases working, unfortunately doesn't seem to work well

* fix bad refactor

* refactored, move purchasing logic to the orchestrator, added processing of results of SK 2 purchases to the orchestrator and the sk2 listener

* added arch checks in a few places to fix builds in armv7

* added another todo

* updated test for ProductsManager in StoreKit Test

* renamed `Product.swift` -> `ProductWrapper.swift`

* increased timeout for test

* added checks to ensure test compatibility with lower iOS versions

* ProductWrapper -> ProductDetails

* import Purchases -> import RevenueCat

* withProductDetailss -> withProductDetails

* productDetailss -> productDetails

* productsFromOptimalStore -> productsFromOptimalStoreKitVersion

* linting

* `Task.init {` -> `Task {`

* added comment explaining explicit cancel

* more improvements from PR comments

* `} catch let error {` -> `} catch {`

* readability improvements

* move init to the top for consistency

* extracted logging string into PurchasesString

* extracted another string

* added todo comment

* improvements from PR comments, removed redundant method

* removed unused method, more renames and improvements from PR comments

* updates xcode version for CI

* split files into StoreKit 1 and StoreKit 2 groups

* fix indentation

* fixed rebase issues

* Fix PurchaseTester project (#847)

* CheckTrialOrIntroPriceEligibility StoreKit2 support (#807)

* Sk2: fetch products, make purchases (#800)

* added product struct

* added Product protocol and separated wrappers for sk1 and sk2

* added price and localizedPriceString to Product

* added bridging code and first call to generic productsWithIdentifiers

* a lot of cleanup, added a couple more properties for products

* added subscription group id and cleaned up a bit

* Updated productsManager so it forwards the products calls to fetchers for sk1 and sk2

* updated a few tests and API availability checks

* updated a few methods to use productwrapper instead of skproduct

* updated tests in many places and apis

* fixed rebase issues

* fixed a few todos

* fixed a few issues caught by swiftlint

* fixed rebase issues and some visibility issues

* updated a few places to use SK2

* added horrifyingly hacky implementation for purchasing with sk2

* small cleanup, re-added method for getting SKProducts directly

* cleanup

* added caching to sk2 products fetcher

* removed trailing whitespace

* slight cleanup

* added more clarifying comments

* another cleanup

* added missing availability marks for macOS

* fixed availability marks for ProductsFetcher in ProductsManager

* yet another fix for macOS availability checks

* and more fixes for macOS version since 13.0 doesn't exist

* fixed issues in api tester

* fixed pod lib lint on non-arch64 architectures

* bundle update fastlane

* added test for dictionary += operator

* removed unnecessary method for fetching product wrappers

* cleanup file names

* updated references in StoreKitTests

* fixed targets for test file

* fixed rebase issues

* added StoreKit 2 transaction listener in the hopes of getting purchases working, unfortunately doesn't seem to work well

* fix bad refactor

* refactored, move purchasing logic to the orchestrator, added processing of results of SK 2 purchases to the orchestrator and the sk2 listener

* added arch checks in a few places to fix builds in armv7

* added another todo

* updated test for ProductsManager in StoreKit Test

* renamed `Product.swift` -> `ProductWrapper.swift`

* increased timeout for test

* added checks to ensure test compatibility with lower iOS versions

* ProductWrapper -> ProductDetails

* import Purchases -> import RevenueCat

* withProductDetailss -> withProductDetails

* productDetailss -> productDetails

* productsFromOptimalStore -> productsFromOptimalStoreKitVersion

* linting

* `Task.init {` -> `Task {`

* added comment explaining explicit cancel

* more improvements from PR comments

* `} catch let error {` -> `} catch {`

* readability improvements

* move init to the top for consistency

* extracted logging string into PurchasesString

* extracted another string

* added todo comment

* improvements from PR comments, removed redundant method

* removed unused method, more renames and improvements from PR comments

* updates xcode version for CI

* split files into StoreKit 1 and StoreKit 2 groups

* fix indentation

* adds check intro trial sk2 support

* fixes and renames

* removes debugging variables

* fixes and use of ProductsManager

* fix sk2Product isEligibleForIntroOffer

* remove swiftlint warning

* adds header and links to issues

* fix strings

* early return

* indentation fix

* removes maccatalyst

* fixes compilation and renames to checkEligibility

* changes on ProductsManager adding a specific sk2 function

* makes changes in TrialOrIntroPriceEligibilityChecker

* rename function to sk2ProductDetails

* some renaming

* duplicated ProductsFetcherSK1Tests.swift

* add XCTUnwrap

* revert

Co-authored-by: aboedo <andresboedo@gmail.com>

* fixed offeringsManagerTests (#856)

* Separate storekit test and backend tests (#845)

* Sk2: fetch products, make purchases (#800)

* added product struct

* added Product protocol and separated wrappers for sk1 and sk2

* added price and localizedPriceString to Product

* added bridging code and first call to generic productsWithIdentifiers

* a lot of cleanup, added a couple more properties for products

* added subscription group id and cleaned up a bit

* Updated productsManager so it forwards the products calls to fetchers for sk1 and sk2

* updated a few tests and API availability checks

* updated a few methods to use productwrapper instead of skproduct

* updated tests in many places and apis

* fixed rebase issues

* fixed a few todos

* fixed a few issues caught by swiftlint

* fixed rebase issues and some visibility issues

* updated a few places to use SK2

* added horrifyingly hacky implementation for purchasing with sk2

* small cleanup, re-added method for getting SKProducts directly

* cleanup

* added caching to sk2 products fetcher

* removed trailing whitespace

* slight cleanup

* added more clarifying comments

* another cleanup

* added missing availability marks for macOS

* fixed availability marks for ProductsFetcher in ProductsManager

* yet another fix for macOS availability checks

* and more fixes for macOS version since 13.0 doesn't exist

* fixed issues in api tester

* fixed pod lib lint on non-arch64 architectures

* bundle update fastlane

* added test for dictionary += operator

* removed unnecessary method for fetching product wrappers

* cleanup file names

* updated references in StoreKitTests

* fixed targets for test file

* fixed rebase issues

* added StoreKit 2 transaction listener in the hopes of getting purchases working, unfortunately doesn't seem to work well

* fix bad refactor

* refactored, move purchasing logic to the orchestrator, added processing of results of SK 2 purchases to the orchestrator and the sk2 listener

* added arch checks in a few places to fix builds in armv7

* added another todo

* updated test for ProductsManager in StoreKit Test

* renamed `Product.swift` -> `ProductWrapper.swift`

* increased timeout for test

* added checks to ensure test compatibility with lower iOS versions

* ProductWrapper -> ProductDetails

* import Purchases -> import RevenueCat

* withProductDetailss -> withProductDetails

* productDetailss -> productDetails

* productsFromOptimalStore -> productsFromOptimalStoreKitVersion

* linting

* `Task.init {` -> `Task {`

* added comment explaining explicit cancel

* more improvements from PR comments

* `} catch let error {` -> `} catch {`

* readability improvements

* move init to the top for consistency

* extracted logging string into PurchasesString

* extracted another string

* added todo comment

* improvements from PR comments, removed redundant method

* removed unused method, more renames and improvements from PR comments

* updates xcode version for CI

* split files into StoreKit 1 and StoreKit 2 groups

* fix indentation

* updated all references from StoreKitTests -> BackendIntegrationTests

* updated references in a few more places

* updated name of target back to StoreKitTests so the cert doesn't get updated 🙄

* fixed issues in tests

* updated arch checks for arm devices from if arm64 to if !arm, so that the code will run successfully in intel macs

* upgraded deployment target to 12.0 to fix issues when compiling StoreKit 2.
Removed arch checks.

* added separate `UnitTestsHostApp` since the `StoreKitTest` app has higher minimum deployment target than the unit tests target

* added separate scheme for unit tests to address the need of StoreKitTest

* fixed scheme name for Scanfile

* small fixes

* added skipping of test depending on OS version availability

* added pre-warming of iOS device since tests aren't starting up correctly in CI

* added pre-warming of iphone 6 and tv

* fixed devices setup since iPhone 6 is no longer available in CircleCI

* renamed StoreKitTestApp + StoreKitTests -> BackendIntegrationTests + HostApp

* more fixes to naming

* updated Nimble version, more fixes to paths

* removed host app for regular unit tests, fixed setup

* even more naming fixes, updated the scan schemes so we don't try to test appleTV for the StoreKitUnitTests

* enabled backend_integration_tests for all commits

* added missing dependency to RevenueCat framework from StoreKitUnitTests target

* fixed dependencies between targets, which would compile more targets than necessary and would have issues where the main framework would get built for the wrong platform

* update fastlane

* fixed lane name

* fixed deployment target for backend integration tests

* updated scan device OS for backend integration tests to 15.0

* fixed integration tests running wrong fastlane lane, added pre-warming devices for regular unit tests, added command line tools installation step

* removed command line tools installation step

* updated device name since iPhone SE isn't available on circleCI

* updated iPhone SE -> iPhone 8 in a couple more places

* removed pre-warming of devices, since it has been removed from Xcode 13

* removed 14.5 device from tests for now

* removed signing from backend integration tests

* fixed rebase issues

* Sk2: ProductDetails cleanup and improvements (#832)

* moved logic to wrap products into productsFetcher, added basic test to compare sk1Wrapper and sk2Wrapper

* added more checks to cover all existing properties for productWrappers

* added test to check that sk1 wrapper works correctly

* added test for SK2 product wrapper

* renamed internal method `purchase(product:` -> `purchase(sk1Product:`

* moved StoreKit2TransactionListener into corresponding group in project

* added base file for PurchaseOrchestratorTests, improved a couple of version checks for tests

* updated imports to `RevenueCat`

* re-added @available in a couple of tests

* update naming: ProductWrapper -> ProductDetails

* fix rebasing issue

* added type aliases for legacy and new skproduct, updated references to them in many places

* renamed mockSKProduct -> mockLegacySKProduct

* more cleanup

* updated naming in a few more places

* and more naming updates

* final batch of naming updates

* updated naming from new and legacy sk products to sk1 and sk2 products

* fixed naming issues with variable names that started in uppercase

* more fixes to variable names

* even more naming fixes

* final batch of naming updates, rebase fixes

* several fixes from rebase

* removed another arch check

* fixes from PR comments

* fixed missing mocks for MockProductsManager

* more "productDetailss" var renames

* removed scan_scheme env variable since we're setting it manually

* added extra test configuration for UnitTests scheme, set test ordering to random

* small ci configuration updates

* added more generous timeout for one test case

* added pre-warming of simulators

* added device pre-warming at the fastlane level

* added test plan

* added manual sleep of 5 mins to see if that fixes the testing issues

* re-added manual opening of simulators, otherwise the wait makes no sense

* made the wait for simulator bit only happen in ci

* improvement from PR comments

* fixed one reason for app crash in iOS < 15, since SceneDelegate was missing

* added check for subscriptionGroupIdentifier

* updated to use XCTSkip instead of early return in a couple of tests

* Tests for CheckTrialOrIntroductoryPriceEligibility StoreKit2 using StoreKitTests (#863)

* Storekit 2: fix tests for iOS 14.5 (#890)

* updated storage of underlyingSK2Product to use Any to prevent crashes in 14.5 devices

* added comment and small cleanup

* re-added iOS 14.5 devices to fastlane scan

* fixed rebase issues

* merge storekit_2_disable_mac_builds

* Sk2 purchase tests (#873)

* added tests skeleton, cleaned up handling of purchase sk2 package

* code clean up, added mocks to sk unit tests target, clean up tests code

* added mockStoreKit2Listener, fixed purchasesOrchestator test

* implemented missing test cases

* casted SK2Product to any for storing to prevent linking issues

* fixed more issues with linking + moved PurchasesOrchestratorTests to storekit tests

* linting

* fixed duplicate files in build phase

* fixed more issues with linking on older OS

* fixed rebase issues

* fix one test in SwiftAPITester

* updated xcode version for swift api tester

* updated api testers to use an existing bundle id to prevent code signing issues

* remove development team + undo bundle id updates

* added fastlane match readonly step

* re-add dev team

* re-add dev team to release builds for objc api tester ios

* updated certs to use fastlane match

* specified missing params for match

* fixed copy/paste issue

* `MockStoreKit2Listener` -> `MockStoreKit2TransactionListener`

* added clearing of user defaults before every test run

* added crude handling of the user cancelled case for SK2 purchases.

* fixed indentation

* updated test name to reflect what it's actually testing

* reset the value of `failTransactionsEnabled` before every test

* moved to using `resetToDefaultState`

* Removes `RequiresXcode13` (#895)

* improve pre-warming and fix flaky tests (#897)

* replaced manual pre-warming with orb

* removed appleTV from prewarming list

* removed duplicate source file

* added test timeouts

* added artificial wait before running storekit tests

* made the artificial wait run only once

* removed unnecessary param

* moved the `Self.hasWaited = true` line above, removed unnecessary parenthesis

* doubled the wait time just in case, made it a static let.

* doubled initial wait time again

* removed another instance of `wait_for_simulator:true`

* Temporarily disable sk2 purchases (#898)

* added a feature flag to disable SK2 temporarily

* fixed tests

* Show Manage Subscriptions public API (#896)

* fix rebase issue

* fixed rebase issues

* Re-enable macOS builds (#923)

* updated xcode version to 13.1.0

* re-enabled macOS builds, re-added API tester for macOS

* Merge main into storekit_2 (#930)

* Begin Refund Request (#924)

* Fix/explicit errors on tasks (#940)

* replaced `Task.init` with `_ = Task<Void, Never>`, so that if the contents of the task throw, the compiler forces us to handle the exception

* added link with explanation to the swift style guide

* Fix: storekit 2 tests on older OS versions (#951)

* removed duplicate line for devices

* fixed tests for older os versions by not storing SK2 types directly in the tests target.

* fixed copy/pasta

* merged main into sk2 (#952)

* improvements from PR comments

* more improvements from PR comments

* even more improvements from PR comments

* more improvements from PR comments

* updated to use the new lock

* removed outdated comment

* added missing cases to switch

* refactor to pass in the systemInfo to productsManager, and to reuse existing instances for intro eligiblity

* made useStoreKit2IfAvailable an instance variable instead of static

* added test cases for fetching from optimal sk with different sk version preferences

* fixed instance of the wrong method being called from overriden `setUpWithError`

* oops, fixed missing `try`

* added more detail to fatalError message when sk version can't be determined

* split tests for `TrialOrIntroPriceEligibilityChecker` into SK1 and SK2

* fix merge conflicts

Co-authored-by: Cesar de la Vega <cesarvegaro@gmail.com>
Co-authored-by: beylmk <maddie@revenuecat.com>
2021-11-22 12:37:33 -03:00
NachoSoto a471353116 Using @unknown default to ensure we handle future cases (#963)
I like to take some credit in this https://twitter.com/NachoSoto/status/943880484978769921?s=20
2021-11-18 09:58:17 -08:00
NachoSoto 3ed96da7bf Updated all uses of "Note" in docs to enhanced format (#966) 2021-11-18 08:24:10 -08:00
NachoSoto 697d5e3b48 Magic Weather SwiftUI: copy RevenueCat.framework (#964) 2021-11-18 08:22:09 -08:00
NachoSoto 25260400ad MagicWeatherSwiftUI: replaced SPM dependency with RevenueCat.xcodeproj (#946)
This allows debugging and changing the SDK code while building the example project.
2021-11-15 16:22:35 -08:00
NachoSoto cf7d3ec665 MagicWeatherSwiftUI: added support for MacCatalyst (#942) 2021-11-15 12:44:20 -08:00
Joshua Liebowitz 271fd11412 Update examples for api updates (#918)
Add deprecations for renamed purchase methods so Xcode can suggest the rename.
Update purchase methods for named completion block instead of _
2021-10-22 15:59:13 -07:00
Mario de Frutos Dieguez 8d98936f9a Fixes with the new RevenueCat package (#870)
* Fixes with the new RevenueCat package

Signed-off-by: Mario de Frutos <mario@defrutos.org>

* CR changes

Signed-off-by: Mario de Frutos <mario@defrutos.org>
2021-09-24 10:57:53 -03:00
Joshua Liebowitz f1dd6268c9 Merge branch 'swift_migration' into RCv4
Plus enable integration tests for CI
2021-09-03 10:35:23 -07:00