Skip to content

Conversation

@ianrumac
Copy link
Collaborator

@ianrumac ianrumac commented Aug 8, 2025

Changes in this pull request

  • Adds Customer API

Checklist

  • All unit tests pass.
  • All UI tests pass.
  • Demo project builds and runs.
  • I added/updated tests or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
  • I have run ktlint in the main directory and fixed any issues.
  • I have updated the SDK documentation as well as the online docs.
  • I have reviewed the contributing guide

@ianrumac ianrumac force-pushed the ir/feat/customer-info-api branch 2 times, most recently from ad0b67d to 865f9e4 Compare August 8, 2025 15:33
@ianrumac ianrumac force-pushed the ir/feat/customer-info-api branch from 865f9e4 to 12b366e Compare August 19, 2025 15:07
val entitlements: List<Entitlement>,
/** Internally set to `true` on first ever load of CustomerInfo. */
@SerialName("isBlank")
internal val isBlank: Boolean = false,
Copy link
Contributor

Choose a reason for hiding this comment

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

I renamed this to isPlaceholder to be more accurate, with an updated comment:

/// Indicates whether this is a placeholder CustomerInfo that hasn't been populated with real data yet.
/// true means this is the initial placeholder state before data has been loaded.
/// false means real data has been loaded (even if that data is empty).

@SerialName("type")
val type: Type = Type.SERVICE_LEVEL,
/**
*Added on device after retrieving from server.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment should relate to all the variables below this point, not just isActive

*
* If one or more lifetime products unlock this entitlement, the `latestProductId` will always be the product identifier of the first lifetime product.
*
* This is `null` if there aren't any transactions that unlock this entitlement.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add "or if it was manually granted from Superwall."

/**
* Indicates whether the last subscription transaction associated with this entitlement will auto renew.
*
* This is `null` if there aren't any transactions that unlock this entitlement.
Copy link
Contributor

Choose a reason for hiding this comment

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

" or if it was manually granted from Superwall."

* The state of the last subscription transaction associated with the
* entitlement.
*
* This is `null` if there aren't any transactions that unlock this entitlement.
Copy link
Contributor

Choose a reason for hiding this comment

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

" or if it was manually granted from Superwall."

* Indicates whether the last subscription transaction associated with this
* entitlement was revoked.
*
* This is `null` if there aren't any transactions that unlock this entitlement.
Copy link
Contributor

Choose a reason for hiding this comment

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

or if it was manually granted from Superwall.

@ianrumac ianrumac force-pushed the ir/feat/customer-info-api branch from 12b366e to 8a50ea6 Compare November 19, 2025 15:59
* Indicates whether the last subscription transaction associated with this
* entitlement is in a billing grace period state.
*
* This is `null` if there aren't any transactions that unlock this entitlement.
Copy link
Contributor

Choose a reason for hiding this comment

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

or if it was manually granted from Superwall.

@Serializable
data class WebEntitlements(
@SerialName("entitlements")
val entitlements: List<Entitlement>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the EntitlementsResponse equiv? If so we only need the customerInfo now, not these entitlements

@SerialName("codes")
val codes: List<RedemptionResult>,
@SerialName("entitlements")
val entitlements: List<Entitlement>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need these now


// StoreProductType interface implementations
override val productType: String
get() = "stripe"
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't figure out how this is used, just leaving a comment to double check that this shouldn't be in caps

Comment on lines -594 to -600
.let {
if (factory.makeSuperwallOptions().enableExperimentalDeviceVariables) {
it.plus(latestExperimentalDeviceProperties())
} else {
it
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep experimental device properties for those that are using them

override val key: String
get() = "store.latestCustomerInfo"
override val directory: SearchPathDirectory
get() = SearchPathDirectory.APP_SPECIFIC_DOCUMENTS
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 a user specific document, not app specific

override val key: String
get() = "store.latestDeviceCustomerInfo"
override val directory: SearchPathDirectory
get() = SearchPathDirectory.APP_SPECIFIC_DOCUMENTS
Copy link
Contributor

Choose a reason for hiding this comment

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

It's user specific not app specific

@ianrumac ianrumac force-pushed the ir/feat/customer-info-api branch from e60040c to bafe1b4 Compare December 1, 2025 13:13
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