-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EXTERNAL] Add ExperimentalPreviewRevenueCatPurchasesAPI
opt-in requirement to Purchases.awaitCustomerInfo()
#1060
[EXTERNAL] Add ExperimentalPreviewRevenueCatPurchasesAPI
opt-in requirement to Purchases.awaitCustomerInfo()
#1060
Conversation
…to await customer info purchases extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening. I think this makes a lot of sense to me. What do you think @tonidero
import kotlinx.coroutines.test.runTest | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.annotation.Config | ||
|
||
@OptIn(ExperimentalPreviewRevenueCatPurchasesAPI::class, ExperimentalCoroutinesApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ExperimentalCoroutinesApi
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's needed to remove the runTest
warning:
This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
@MustBeDocumented
@Retention(value = AnnotationRetention.BINARY)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.ANNOTATION_CLASS,
AnnotationTarget.PROPERTY,
AnnotationTarget.FIELD,
AnnotationTarget.LOCAL_VARIABLE,
AnnotationTarget.VALUE_PARAMETER,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER,
AnnotationTarget.TYPEALIAS
)
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
public annotation class ExperimentalCoroutinesApi
I can remove it if you prefer so, as it's not mandatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing it today, but I didn't yesterday! Weird, I was very confused 😆
Thanks for taking the time taking screenshots and explaining
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradle...
Yeah I think this makes sense. We probably won't get many users if they need to use this annotation, but if the API is subject to change, that's how it should be 👍 |
You know that we developers love to live on the edge 🔥 😅 Jokes aside, I believe a bunch of customers will start using it (especially the ones that already use / integrate Coroutines in their codebase / apps) and we can start gathering feedback 🚀 |
Yeah, in any case I think this is a good addition 👍 |
ExperimentalPreviewRevenueCatPurchasesAPI
opt-in requirement to Purchases.awaitCustomerInfo()
ExperimentalPreviewRevenueCatPurchasesAPI
opt-in requirement to Purchases.awaitCustomerInfo()
0578c24
into
RevenueCat:external/pablo-guardiola/pg-add-experimental-preview-revenuecat-api
…uirement to `Purchases.awaitCustomerInfo()` (#1060) <!-- Thank you for contributing to Purchases! Before pressing the "Create Pull Request" button, please provide the following: --> ### Checklist - [ ] If applicable, unit tests - [ ] If applicable, create follow-up issues for `purchases-ios` and hybrids ### Motivation **Why is this change required? What problem does it solve?** Follow up from https://github.com/RevenueCat/purchases-android/pull/1012/files#r1223917692 Instead of only noting that `Purchases.awaitCustomerInfo()` is experimental in the docs (which are often overlooked 😬), we can be more explicit and add an opt-in requirement annotation `ExperimentalPreviewRevenueCatPurchasesAPI`. Capturing from the [Kotlin Opt-in requirements docs](https://kotlinlang.org/docs/opt-in-requirements.html): > The Kotlin standard library provides a mechanism for requiring and giving explicit consent for using certain elements of APIs. This mechanism lets library developers inform users of their APIs about specific conditions that require opt-in, for example, if an API is in the experimental state and is likely to change in the future. > > To prevent potential issues, the compiler warns users of such APIs about these conditions and requires them to opt in before using the API. This opens the door to use this annotation in any other APIs which are experimental, in preview or under cooking, to get initial feedback and iterate "without" breaking SemVer 🚀 <!-- Please link to issues following this format: Resolves #999999 --> ### Description **Describe your changes in detail** - Create `ExperimentalPreviewRevenueCatPurchasesAPI` opt-in requirement annotation - Opt in to using `ExperimentalPreviewRevenueCatPurchasesAPI` wherever `Purchases.awaitCustomerInfo()` is called **Please describe in detail how you tested your changes** - Run `purchases` tests - Run `examples.purchase-test` app cc @tonidero @vegaro
…uirement to `Purchases.awaitCustomerInfo()` (#1060) (#1065) <!-- Thank you for contributing to Purchases! Before pressing the "Create Pull Request" button, please provide the following: --> ### Checklist - [ ] If applicable, unit tests - [ ] If applicable, create follow-up issues for `purchases-ios` and hybrids ### Motivation **Why is this change required? What problem does it solve?** Follow up from https://github.com/RevenueCat/purchases-android/pull/1012/files#r1223917692 Instead of only noting that `Purchases.awaitCustomerInfo()` is experimental in the docs (which are often overlooked 😬), we can be more explicit and add an opt-in requirement annotation `ExperimentalPreviewRevenueCatPurchasesAPI`. Capturing from the [Kotlin Opt-in requirements docs](https://kotlinlang.org/docs/opt-in-requirements.html): > The Kotlin standard library provides a mechanism for requiring and giving explicit consent for using certain elements of APIs. This mechanism lets library developers inform users of their APIs about specific conditions that require opt-in, for example, if an API is in the experimental state and is likely to change in the future. > > To prevent potential issues, the compiler warns users of such APIs about these conditions and requires them to opt in before using the API. This opens the door to use this annotation in any other APIs which are experimental, in preview or under cooking, to get initial feedback and iterate "without" breaking SemVer 🚀 <!-- Please link to issues following this format: Resolves #999999 --> ### Description **Describe your changes in detail** - Create `ExperimentalPreviewRevenueCatPurchasesAPI` opt-in requirement annotation - Opt in to using `ExperimentalPreviewRevenueCatPurchasesAPI` wherever `Purchases.awaitCustomerInfo()` is called Note that this isn't a breaking change since coroutines haven't shipped yet. **Please describe in detail how you tested your changes** - Run `purchases` tests - Run `examples.purchase-test` app Contributed by @pablo-guardiola Co-authored-by: pablo-guardiola <[email protected]>
**This is an automatic release.** ### New experimental features * Trusted entitlements (#1048) via Toni Rico (@tonidero) This new feature prevents MitM attacks between the SDK and the RevenueCat server. With verification enabled, the SDK ensures that the response created by the server was not modified by a third-party, and the entitlements received are exactly what was sent. This is 100% opt-in. `EntitlementInfos` have a new `VerificationResult` property, which will indicate the validity of the responses when this feature is enabled. This feature is experimental and requires opt in. It's also only available in Kotlin. ```kotlin @OptIn(ExperimentalPreviewRevenueCatPurchasesAPI::class) fun configureRevenueCat() { val configuration = PurchasesConfiguration.Builder(context, apiKey) .informationalVerificationModeAndDiagnosticsEnabled(true) .build() Purchases.configure(configuration) } ``` * Add Coroutine support to Purchases#getCustomerInfo (#1012) via Cesar de la Vega (@vegaro) ### Bugfixes * [EXTERNAL] Fix `README` `CONTRIBUTING` guide broken link (#1035) via @pablo-guardiola (#1036) via Toni Rico (@tonidero) ### Dependency Updates * Update targetSDK version to 33 (#1050) via Toni Rico (@tonidero) * Update gradle plugin to 8.0.2 (#1049) via Toni Rico (@tonidero) * Bump danger from 9.3.0 to 9.3.1 (#1054) via dependabot[bot] (@dependabot[bot]) * [EXTERNAL] Update Kover to 0.7.0 (#1031) via @mikescamell (#1037) via Toni Rico (@tonidero) ### Other Changes * [EXTERNAL] Add `ExperimentalPreviewRevenueCatPurchasesAPI` opt-in requirement to `Purchases.awaitCustomerInfo()` (#1060) (#1065) via Toni Rico (@tonidero) * Update to latest android executor image (#1062) via Toni Rico (@tonidero) * Diagnostics: Track http requests as counters (#1047) via Toni Rico (@tonidero) * Fix backend integration test flakiness (#1053) via Toni Rico (@tonidero) * [EXTERNAL] Replace `@Deprecated` usage of `skus` by `productIds` from`PurchasedProductsFetcher` (#986) via @pablo-guardiola (#1044) via Toni Rico (@tonidero) * [EXTERNAL] Add `MagicWeather` app note to the main `README` and fix a typo (#1041) (#1043) via Toni Rico (@tonidero) * Detekt enable trailing comma (#1046) via Toni Rico (@tonidero) * Detekt update to 1.23.0 and run autocorrect (#1045) via Toni Rico (@tonidero) * [PurchaseTester] Update CustomerInfo from listener in overview screen (#1034) via Toni Rico (@tonidero) --------- Co-authored-by: revenuecat-ops <[email protected]> Co-authored-by: Toni Rico <[email protected]>
Checklist
purchases-ios
and hybridsMotivation
Why is this change required? What problem does it solve?
Follow up from https://github.com/RevenueCat/purchases-android/pull/1012/files#r1223917692
Instead of only noting that
Purchases.awaitCustomerInfo()
is experimental in the docs (which are often overlooked 😬), we can be more explicit and add an opt-in requirement annotationExperimentalPreviewRevenueCatPurchasesAPI
.Capturing from the Kotlin Opt-in requirements docs:
This opens the door to use this annotation in any other APIs which are experimental, in preview or under cooking, to get initial feedback and iterate "without" breaking SemVer 🚀
Description
Describe your changes in detail
ExperimentalPreviewRevenueCatPurchasesAPI
opt-in requirement annotationExperimentalPreviewRevenueCatPurchasesAPI
whereverPurchases.awaitCustomerInfo()
is calledPlease describe in detail how you tested your changes
purchases
testsexamples.purchase-test
appcc @tonidero @vegaro