-
Notifications
You must be signed in to change notification settings - Fork 51
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
CustomEntitlementComputation: Configure method for customEntitlementComputation mode #1168
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,19 +96,11 @@ static void check(final Purchases purchases, final Map<String, String> attribute | |
} | ||
|
||
static void checkConfiguration(final Context context, | ||
final ExecutorService executorService) { | ||
final ExecutorService executorService, | ||
final PurchasesConfiguration purchasesConfiguration) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleaner since this is already tested 👍🏻 |
||
final boolean configured = Purchases.isConfigured(); | ||
|
||
PurchasesConfiguration build = new PurchasesConfiguration.Builder(context, "") | ||
.appUserID("") | ||
.observerMode(true) | ||
.observerMode(false) | ||
.service(executorService) | ||
.diagnosticsEnabled(true) | ||
.entitlementVerificationMode(EntitlementVerificationMode.INFORMATIONAL) | ||
.build(); | ||
|
||
Purchases.configure(build); | ||
Purchases.configure(purchasesConfiguration); | ||
|
||
final boolean debugLogs = Purchases.getDebugLogsEnabled(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,15 @@ static void checkConfiguration(final Context context, | |
Purchases.setProxyURL(new URL("")); | ||
final URL proxyURL = Purchases.getProxyURL(); | ||
|
||
PurchasesConfiguration build = new PurchasesConfiguration.Builder(context, "") | ||
.appUserID("") | ||
.observerMode(true) | ||
.observerMode(false) | ||
.service(executorService) | ||
.diagnosticsEnabled(true) | ||
.entitlementVerificationMode(EntitlementVerificationMode.INFORMATIONAL) | ||
.build(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't really needed for the |
||
|
||
final Purchases instance = Purchases.getSharedInstance(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,16 +224,24 @@ class Purchases internal constructor( | |
/** | ||
* Configures an instance of the Purchases SDK with a specified API key. The instance will | ||
* be set as a singleton. You should access the singleton instance using [Purchases.sharedInstance] | ||
* @param configuration: the [PurchasesConfiguration] object you wish to use to configure [Purchases]. | ||
* @param context: the Application context object of your Application. | ||
* @param apiKey: the API Key for your app. Obtained from the RevenueCat dashboard. | ||
* @param appUserID: a unique id for identifying the user. | ||
* @return An instantiated `[Purchases] object that has been set as a singleton. | ||
*/ | ||
@JvmStatic | ||
fun configure( | ||
configuration: PurchasesConfiguration, | ||
fun configureInCustomEntitlementsComputationMode( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means that in this mode, anything else that can be enabled in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup we want to be very opinionated for this mode 👍🏻 |
||
context: Context, | ||
apiKey: String, | ||
appUserID: String, | ||
): Purchases { | ||
if (isConfigured) { | ||
infoLog(ConfigureStrings.INSTANCE_ALREADY_EXISTS) | ||
} | ||
val configuration = PurchasesConfiguration.Builder(context, apiKey) | ||
.appUserID(appUserID) | ||
.dangerousSettings(DangerousSettings(customEntitlementComputation = true)) | ||
.build() | ||
return PurchasesFactory().createPurchases( | ||
configuration, | ||
platformInfo, | ||
|
This file was deleted.
This file was deleted.
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.
👍🏻