16 Commits
Author SHA1 Message Date
Antonio PallaresandAxel Le Pennec cf71bf1ddb [EXTERNAL] Adds a convenience method to set the Amplitude User ID and Amplitude Device ID (#5425) via @alpennec (#5446)
* [EXTERNAL] Adds a convenience method to set the Amplitude User ID ($amplitudeUserId) and Amplitude Device ID ($amplitudeDeviceId) (#5425)

* Adding Amplitude UserID and DeviceID

* Add convenience method for setting Amplitude User ID and Amplitude Device ID

* fix lint

---------

Co-authored-by: Axel Le Pennec <alpennec@users.noreply.github.com>
2025-08-01 09:55:35 +02:00
NachoSoto 2bcd0ce328 5.0.0 changes: support SK2 by default 2024-07-01 14:37:21 -05:00
NachoSoto 8e35eb7e39 Documentation: add reference to TestStoreProduct (#2743) 2023-07-05 10:56:03 -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
NachoSoto b3875a9380 Exposed PurchasesReceiptParser and AppleReceipt (#2153)
Initial step for [CSDK-17]. Fixes [CSDK-523].

### Changes:
- Renamed `ReceiptParser` to `PurchasesReceiptParser` to avoid name
collision with future SPM `ReceiptParser`
- Exposed `ReceiptParser`, `AppleReceipt`,
`PurchasesReceiptParser.Error`
- Added new types to `SwiftAPITester`
- Added docs to these types
- Moved `LoggerType` to be available to `ReceiptParser`
- Moved `DateFormatter+Extensions` to be available to `ReceiptParser`
- Moved `Codable+Extensions` to be available to `ReceiptParser`
- Created `ReceiptParserLogger` for `ReceiptParser`


[CSDK-17]:
https://revenuecats.atlassian.net/browse/CSDK-17?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

[CSDK-523]:
https://revenuecats.atlassian.net/browse/CSDK-523?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-12-22 10:09:12 -08:00
NachoSoto faf51e3d99 Introduced PurchasesDiagnostics to help diagnose SDK configuration errors (#1977)
Finishes [CSDK-451].

This new small public API allows users to quickly figure out if
everything in the SDK is correctly configured in a simple way:
```swift
let diagnostics = PurchasesDiagnostics.default
do {
    try await diagnostics.testSDKHealth()
} catch {
    print(error)
}
```

The specific underlying errors will provide information about what
failed.

We can continue growing this to check for more specific things, but for
now it does 4 things:
- Verify API connectivity: networking issues, firewalling, etc.
- Verify API key is correct
- Verify `Offerings` are configured correctly
- Verify that all products in `Offerings` are configured correctly and
found in `StoreKit`

This new API is covered by:
- API testers
- Unit tests
- Integration tests (both on `SK1` and `SK2`)

_I've taken the "shortcut" of making this `async` only (while still
compatible with Objective-C), which means it's not compatible with iOS
12.x. But that made the implementation a lot simpler, which I think is a
useful tradeoff._

### Depends on:
- #1970
- #1971
- #1973
- #1974
- #1975
- #1976

[CSDK-451]:
https://revenuecats.atlassian.net/browse/CSDK-451?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-10-27 12:00:53 -07:00
NachoSoto 74233408c4 Docs: fixed logIn references (#2002) 2022-10-26 14:43:43 -07:00
NachoSoto a4bf2647f8 Purchases.configure: added overload taking a Configuration.Builder (#1720)
Fixes [CF-780].

See https://github.com/RevenueCat/purchases-ios/issues/1717#issuecomment-1160718519 for an example of a user trying to do this.
2022-06-21 12:34:11 -07:00
Joshua Liebowitz 2d0a9e8820 Update doc reference to `Purchases/customerInfo(fetchPolicy:)` (#1636)
* Update doc reference to ``Purchases/customerInfo(fetchPolicy:)``
* Replace ``Purchases/customerInfo()`` with ``Purchases/customerInfo(fetchPolicy:)``
2022-05-31 15:26:17 -07:00
aboedo 85bff6d467 cleaned up docs for the configure method (#1623) 2022-05-27 10:24:38 -03:00
aboedo 3fa269a2b4 alphabetized integration subs attributes in documentation and added setCleverTapID (#1530) 2022-04-25 15:04:24 -03:00
aboedo 5679b2b954 expose setPushTokenString method (#1525)
* added setPushTokenString methods

* added links to the new method in docC

* fixed swift api tests

* actually fixed them now, don't know what I was thinking on the previous commit

* fix tests
2022-04-25 14:20:50 -03:00
Cody Kerns 7ee038f20f New public convenience setter for Firebase app instance ID (#1522)
* Adds Firebase convenience setter
2022-04-21 14:20:52 -04:00
Cody Kerns 441058fae7 Add SK2 initializer to DocC (#1468) 2022-04-06 16:17:38 -04:00
aboedo e5710aeaee Static docC docs part 2: folder structure cleanup for docC plugin (#1421)
* added lanes to preview and compile docc docs

* added package dependency on swift-docc-plugin

* ignored all Package.resolved files

* added env variable so that the package doesn't unnecessarily pull in the docC plugin for our customers

* fix linting

* moved docC catalog for spm plugin compatibility, added empty swift file, updated Package.swift so it only builds from sources

* fixed a couple of outdated paths

* added comment to empty file
2022-03-31 12:20:39 -03:00