Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nocodes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1"
api "io.qonversion.android.sdk:sdk:8.2.6"
api project(':sdk')
}

apply from: "../scripts/maven-release.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ internal class ScreenPresenter(

private fun mapProductInfo(product: QProduct): Map<String, Any?> {
val res = mutableMapOf<String, Any?>(
"id" to product.qonversionID,
"store_id" to product.storeID,
"id" to product.qonversionId,
"store_id" to product.storeId,
)

fun enrichWithPriceDetails(price: QProductPrice) {
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/java/io/qonversion/sample/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class HomeFragment : Fragment(), NoCodesDelegate {
product,
object : QonversionEntitlementsCallback {
override fun onSuccess(entitlements: Map<String, QEntitlement>) {
when (product.qonversionID) {
when (product.qonversionId) {
subscriptionProductId -> binding.buttonSubscribe.toSuccessState()
inAppProductId -> binding.buttonInApp.toSuccessState()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ProductsAdapter(
}

fun bind(product: QProduct) = with(itemView) {
binding.txtName.text = product.qonversionID
binding.txtName.text = product.qonversionId
binding.txtDescription.text = product.storeDetails?.description
binding.txtPrice.text = product.prettyPrice
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ internal class OutagerIntegrationTest {
private val annualProduct = QProduct("test_annual", "google_annual", null)
private val inappProduct = QProduct("test_inapp", "no_ads", null)
private val expectedProducts = mapOf(
monthlyProduct.qonversionID to monthlyProduct,
annualProduct.qonversionID to annualProduct,
inappProduct.qonversionID to inappProduct
monthlyProduct.qonversionId to monthlyProduct,
annualProduct.qonversionId to annualProduct,
inappProduct.qonversionId to inappProduct
)

private val expectedOffering = QOffering(
Expand Down Expand Up @@ -358,7 +358,7 @@ internal class OutagerIntegrationTest {
fun eligibilityForProductIds() {
// given
val signal = CountDownLatch(1)
val productIds = listOf(monthlyProduct.qonversionID, annualProduct.qonversionID)
val productIds = listOf(monthlyProduct.qonversionId, annualProduct.qonversionId)

val callback = object : QonversionEligibilityCallback {
override fun onSuccess(eligibilities: Map<String, QEligibility>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ internal class QonversionRepositoryIntegrationTest {
private val annualProduct = QProduct("test_annual", "google_annual", null)
private val inappProduct = QProduct("test_inapp", "no_ads", null)
private val expectedProducts = mapOf(
monthlyProduct.qonversionID to monthlyProduct,
annualProduct.qonversionID to annualProduct,
inappProduct.qonversionID to inappProduct
monthlyProduct.qonversionId to monthlyProduct,
annualProduct.qonversionId to annualProduct,
inappProduct.qonversionId to inappProduct
)

private val expectedOffering = QOffering(
Expand Down Expand Up @@ -556,11 +556,11 @@ internal class QonversionRepositoryIntegrationTest {
fun eligibilityForProductIds() {
// given
val signal = CountDownLatch(1)
val productIds = listOf(monthlyProduct.qonversionID, annualProduct.qonversionID)
val productIds = listOf(monthlyProduct.qonversionId, annualProduct.qonversionId)
val expectedResult = mapOf(
monthlyProduct.qonversionID to QEligibility(QIntroEligibilityStatus.NonIntroOrTrialProduct),
annualProduct.qonversionID to QEligibility(QIntroEligibilityStatus.Unknown),
inappProduct.qonversionID to QEligibility(QIntroEligibilityStatus.NonIntroOrTrialProduct)
monthlyProduct.qonversionId to QEligibility(QIntroEligibilityStatus.NonIntroOrTrialProduct),
annualProduct.qonversionId to QEligibility(QIntroEligibilityStatus.Unknown),
inappProduct.qonversionId to QEligibility(QIntroEligibilityStatus.NonIntroOrTrialProduct)
)

val callback = object : QonversionEligibilityCallback {
Expand Down Expand Up @@ -598,7 +598,7 @@ internal class QonversionRepositoryIntegrationTest {
fun eligibilityForProductIdsError() {
// given
val signal = CountDownLatch(1)
val productIds = listOf(monthlyProduct.qonversionID, annualProduct.qonversionID)
val productIds = listOf(monthlyProduct.qonversionId, annualProduct.qonversionId)

val callback = object : QonversionEligibilityCallback {
override fun onSuccess(eligibilities: Map<String, QEligibility>) {
Expand Down
14 changes: 7 additions & 7 deletions sdk/src/main/java/com/qonversion/android/sdk/Qonversion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,20 @@ interface Qonversion {
fun syncPurchases()

/**
* Call this function to link a user to his unique ID in your system and share purchase data.
* @param userID - unique user ID in your system
* Call this function to link a user to his unique identifier in your system and share purchase data.
* @param userId - unique user identifier in your system
*/
fun identify(userID: String)
fun identify(userId: String)

/**
* Call this function to link a user to his unique ID in your system and share purchase data.
* @param userID - unique user ID in your system
* Call this function to link a user to his unique identifier in your system and share purchase data.
* @param userId - unique user identifier in your system
* @param callback - callback that will be called when response is received
*/
fun identify(userID: String, callback: QonversionUserCallback)
fun identify(userId: String, callback: QonversionUserCallback)

/**
* Call this function to unlink a user from his unique ID in your system and his purchase data.
* Call this function to unlink a user from his unique identifier in your system and his purchase data.
*/
fun logout()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class QonversionConfig internal constructor(
}

/**
* Use this function to disable tracking of Facebook Attribution ID.
* Use this function to disable tracking of Facebook Attribution identifier.
* It may be helpful if you face "Social Account information tracking without
* a prominent disclosure" warning during the Google Play Review.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ data class QEntitlement(
val transactions: List<QTransaction>
) {
internal constructor(permission: QPermission) : this(
permission.permissionID,
permission.permissionId,
permission.startedDate,
permission.expirationDate,
permission.isActive(),
permission.source,
permission.productID,
permission.productId,
QEntitlementRenewState.fromProductRenewState(permission.renewState),
permission.renewsCount,
permission.trialStartDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
class QOffering(
@Json(name = "id") val offeringID: String,
@Json(name = "id") val offeringId: String,
@Json(name = "tag") val tag: QOfferingTag,
@Json(name = "products") val products: List<QProduct> = listOf()
) {

fun productForID(id: String): QProduct? {
return products.firstOrNull { it.qonversionID == id }
fun productForId(id: String): QProduct? {
return products.firstOrNull { it.qonversionId == id }
}

override fun hashCode(): Int {
return offeringID.hashCode()
return offeringId.hashCode()
}

override fun equals(other: Any?): Boolean {
return other is QOffering &&
other.offeringID == offeringID &&
other.offeringId == offeringId &&
other.tag == tag &&
other.products equalsIgnoreOrder products
}

override fun toString(): String {
return "QOffering(offeringID=$offeringID, tag=$tag, products=$products)"
return "QOffering(offeringId=$offeringId, tag=$tag, products=$products)"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ data class QOfferings(
val main: QOffering?,
val availableOfferings: List<QOffering> = listOf()
) {
fun offeringForID(id: String): QOffering? {
return availableOfferings.firstOrNull { it.offeringID == id }
fun offeringForId(id: String): QOffering? {
return availableOfferings.firstOrNull { it.offeringId == id }
}

override fun hashCode(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class QProduct(
@Json(name = "id") val qonversionID: String,
@Json(name = "store_id") val storeID: String?,
@Json(name = "base_plan_id") val basePlanID: String?,
@Json(name = "id") val qonversionId: String,
@Json(name = "store_id") val storeId: String?,
@Json(name = "base_plan_id") val basePlanId: String?,
) {
/**
* The store details of this product containing all the information from Google Play including
* the offers for purchasing the base plan of this product (specified by [basePlanID])
* the offers for purchasing the base plan of this product (specified by [basePlanId])
* in case of a subscription.
* Null, if the product was not found. If the [basePlanID] is not specified for a subscription
* Null, if the product was not found. If the [basePlanId] is not specified for a subscription
* product, this field will be presented but the [QProductStoreDetails.subscriptionOfferDetails]
* will be empty.
*/
Expand All @@ -23,7 +23,7 @@ data class QProduct(
private set

@Transient
var offeringID: String? = null
var offeringId: String? = null

/**
* The subscription base plan duration for this product.
Expand Down Expand Up @@ -61,6 +61,6 @@ data class QProduct(
}

internal fun setStoreProductDetails(productDetails: ProductDetails) {
storeDetails = QProductStoreDetails(productDetails, basePlanID)
storeDetails = QProductStoreDetails(productDetails, basePlanId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import com.android.billingclient.api.Purchase
import javax.inject.Inject

internal class QHandledPurchasesCache @Inject internal constructor() {
private val handledOrderIDs = mutableSetOf<String>()
private val handledOrderIds = mutableSetOf<String>()

fun shouldHandlePurchase(purchase: Purchase): Boolean {
return !handledOrderIDs.contains(purchase.orderId)
return !handledOrderIds.contains(purchase.orderId)
}

fun saveHandledPurchase(purchase: Purchase) {
purchase.orderId?.let {
handledOrderIDs.add(it)
handledOrderIds.add(it)
}
}

fun saveHandledPurchases(purchases: Collection<Purchase>) {
handledOrderIDs.addAll(purchases.mapNotNull { it.orderId })
handledOrderIds.addAll(purchases.mapNotNull { it.orderId })
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ internal class QIdentityManager @Inject constructor(
) {
val currentPartnersIdentityId: String? get() = userInfoService.getPartnersIdentityId()

fun identify(userID: String, callback: IdentityManagerCallback) {
val currentUserID = userInfoService.obtainUserID()
repository.identify(userID, currentUserID,
onSuccess = { resultUserID ->
userInfoService.storePartnersIdentityId(userID)
if (resultUserID.isNotEmpty()) {
userInfoService.storeQonversionUserId(resultUserID)
fun identify(userId: String, callback: IdentityManagerCallback) {
val currentUserId = userInfoService.obtainUserId()
repository.identify(userId, currentUserId,
onSuccess = { resultUserId ->
userInfoService.storePartnersIdentityId(userId)
if (resultUserId.isNotEmpty()) {
userInfoService.storeQonversionUserId(resultUserId)
}

callback.onSuccess(resultUserID)
callback.onSuccess(resultUserId)
},
onError = {
callback.onError(it)
Expand Down
Loading