Commit Graph
13 Commits
Author SHA1 Message Date
Antonio Pallares de879a0889 Use array instead of sets in diagnostics events (#4839)
* tests: remove `Equatable` conformance of `DiagnosticsEvent` and `AnyEncodable` from RevenueCat and added to test targets (where it's needed)

* Use Arrays instead of Sets in Diagnostics events to have predictable order in sent events

* tests: compare Sets vs Arrays in unit test

The conversion from Array --> Set --> Array may change the order of the elements

* remove `DiagnosticsEvent+Equatable` from some targets

* PR #4839 fixes

* remove `AnyEncodable+Equatable.swift` from some targets
2025-03-02 12:50:03 +01:00
James BorthwickandJosh Holtz d40eb1157b Paywall Components Initial Commit (#4224)
Initial components merge. Notes:

- Linting enabled except for public documentation which will come as the
API matures and stabilizes.
- Took out unused files (tier-related ones), which will come back in a
future version. The comments were useful and will be referenced when
they come back so thank you for the comments on these.
- Left in tvOS and watchOS availability checks for now - may revisit
this later.
- Everything is codable.
- Features added:
- Layout components allow other components to be laid out along x/y/z
axes.
- Text component supports font weight. (Changing actual font will come
later.)
  - LinkButton component links out to external website of choice.
- RemoteImage allows the image to be arbitrarily styled by the calling
code by passing the image back in a closure.
- Image component supports corner rounding an overlaid gradient. (These
will likely be pulled out into common code somewhere in a future PR.)
- Support for OfferingResponse that includes a separate
`PaywallComponentsData` structure, which is separate from `PaywallData`
used for template-based paywalls.

---------

Co-authored-by: Josh Holtz <me@joshholtz.com>
2024-08-28 17:11:42 -07:00
James Borthwick aa032028df Improved Error Handling (#3883)
Adds missing user-facing error alerts, makes the error messages more
readable and uses `Error` rather than `NSError` as the type to use when
passing errors for presentation.
 
resolves PWL-458
2024-05-10 15:12:55 -07:00
Cesar de la Vega 6c4d75fc23 iOS append events to JSONL file and get diagnostics events (#3781)
Based off https://github.com/RevenueCat/purchases-ios/pull/2672/

Equivalent to https://github.com/RevenueCat/purchases-android/pull/784/

Adds DiagnosticsEntry classes and implements adding an entry to the
file, getting all entries, and deleting X first entries
2024-04-08 12:47:54 +02:00
Mark Villacampa 679767adf9 Enable explicit_init lint rule and fix issues (#3418)
This rule will warn when calling `init` with the explicit type where it
can be inferred, or where the `.init` part can be omitted.
2023-11-16 00:20:00 +01:00
NachoSoto ceddc84045 Paywalls: add PaywallData.revision (#3155)
This will be used to send it along with the upcoming `PaywallEvent`s.
2023-09-14 18:28:11 -07:00
NachoSoto 7a23d5ba4d Expanded EnsureNonEmptyArrayDecodable to EnsureNonEmptyCollectionDecodable (#3002) 2023-08-14 07:35:41 -07:00
NachoSoto 04ef06ed44 @EnsureNonEmptyArrayDecodable (#2831) 2023-07-18 06:12:41 -07:00
NachoSoto 8483c29f47 New @NonEmptyStringDecodable (#2819)
This allows decorating a `String` property in a `Decodable` type so it
ensures it gets converted to `nil` if it's empty.
It will be used for `PaywallData`.
2023-07-14 15:00:12 -07:00
NachoSoto c5552fa453 IgnoreDecodeErrors: log decoding error (#2778) 2023-07-12 06:35:54 -07:00
NachoSoto a505f04164 AnyEncodable: also implement Decodable (#2769)
This will be used for an upcoming test that uses `AnyEncodable` and
needs to extract the contents.
2023-07-07 15:18:24 -07:00
NachoSoto 33a11cb736 DefaultDecodable: moved to Misc/Codable/DefaultDecodable.swift (#2528) 2023-05-26 07:03:41 -07:00
NachoSoto cb3593d9b7 Refactor: reorganized files in new Security and Misc folders (#2326)
Thanks to @aboedo for the suggestion.

### Changes
- Moved signature verification files and tests to new `Security` folder
- Moved `CacheFetchPolicy` inside `Caching`
- Split files inside `Misc` into subfolders
2023-03-13 11:25:36 -07:00