Skip to content
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

Require experimental annotation for trusted entitlements API #1066

Conversation

tonidero
Copy link
Contributor

Description

This PR has changes from #1060 and is based on #1061

This adds a require opt in requirement to use the trusted entitlements API.

@@ -54,6 +54,7 @@ data class EntitlementInfo(
val billingIssueDetectedAt: Date?,
val ownershipType: OwnershipType,
private val jsonObject: JSONObject,
@ExperimentalPreviewRevenueCatPurchasesAPI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I tried to add this annotation to the VerificationResult and EntitlementVerificationMode enums themselves, but that made it so the whole class required the annotation. So in the end I only added to the APIs where those enums may be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is due to RequiresOptIn Contagiousness.

@tonidero tonidero force-pushed the toniricodiez/sdk-3186-make-enabling-verification-also-enable-diagnostics-android branch from b9c9d6f to 41d997c Compare June 14, 2023 11:48
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

❗ No coverage uploaded for pull request base (bring-back-trusted-entitlements-api@b4965fd). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head f731745 differs from pull request most recent head ed0380c. Consider uploading reports for the commit ed0380c to get more accurate results

@@                          Coverage Diff                           @@
##             bring-back-trusted-entitlements-api    #1066   +/-   ##
======================================================================
  Coverage                                       ?   85.64%           
======================================================================
  Files                                          ?      176           
  Lines                                          ?     6249           
  Branches                                       ?      860           
======================================================================
  Hits                                           ?     5352           
  Misses                                         ?      563           
  Partials                                       ?      334           

*
* Default mode is disabled.
*/
@JvmSynthetic
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it so this method is only available in Kotlin. The alternative is to have it enabled in Java but then there won't be any compiling issue if users try to use this method inadvertently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we planning on releasing this on the hybrids before it's not experimental?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't think we will release it in the hybrids while it's experimental... IMO, we should wait until we are confident in the natives before porting to the hybrids. Lmk if you think otherwise though!

@tonidero tonidero force-pushed the toniricodiez/sdk-3186-make-enabling-verification-also-enable-diagnostics-android branch from 41d997c to 0d23243 Compare June 14, 2023 12:37
@tonidero tonidero force-pushed the toniricodiez/sdk-3190-make-trusted-entitlements-api-require-opt-in-android branch from 14b7431 to f731745 Compare June 14, 2023 12:38
@tonidero tonidero marked this pull request as ready for review June 14, 2023 12:59
@tonidero tonidero requested a review from a team June 14, 2023 13:00
@tonidero tonidero mentioned this pull request Jun 14, 2023
@@ -106,6 +107,7 @@ data class EntitlementInfo(
get() = jsonObject

/** @suppress */
@OptIn(ExperimentalPreviewRevenueCatPurchasesAPI::class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not transitive right? meaning that calling toString doesn't require to opt in as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. If you use @OptIn, it doesn't propagate. It would if I just annotated with the @ ExperimentalPreviewRevenueCatPurchasesAPI again

@pablo-guardiola
Copy link
Contributor

Glad to see that we're leveraging #1065 to mark APIs as experimental 😊

Base automatically changed from toniricodiez/sdk-3186-make-enabling-verification-also-enable-diagnostics-android to bring-back-trusted-entitlements-api June 14, 2023 14:47
@tonidero tonidero force-pushed the toniricodiez/sdk-3190-make-trusted-entitlements-api-require-opt-in-android branch from 47eef03 to ed0380c Compare June 14, 2023 14:49
@tonidero tonidero merged commit cce0fec into bring-back-trusted-entitlements-api Jun 14, 2023
@tonidero tonidero deleted the toniricodiez/sdk-3190-make-trusted-entitlements-api-require-opt-in-android branch June 14, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants