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

OfferingsFactory: debug logs when creating Offerings #1576

Merged
merged 3 commits into from
Jan 26, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ internal abstract class OfferingParser {
* Note: this may return an empty Offerings.
*/
fun createOfferings(offeringsJson: JSONObject, productsById: Map<String, List<StoreProduct>>): Offerings {
log(LogIntent.DEBUG, OfferingStrings.BUILDING_OFFERINGS.format(productsById.size))

val jsonOfferings = offeringsJson.getJSONArray("offerings")
val currentOfferingID = offeringsJson.getString("current_offering_id")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.revenuecat.purchases.common.Dispatcher
import com.revenuecat.purchases.common.LogIntent
import com.revenuecat.purchases.common.OfferingParser
import com.revenuecat.purchases.common.log
import com.revenuecat.purchases.common.verboseLog
import com.revenuecat.purchases.models.StoreProduct
import com.revenuecat.purchases.strings.OfferingStrings
import kotlinx.serialization.SerializationException
Expand Down Expand Up @@ -52,6 +53,7 @@ internal class OfferingsFactory(
),
)
} else {
verboseLog(OfferingStrings.CREATED_OFFERINGS.format(offerings))
onSuccess(offerings)
}
} catch (error: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ internal object OfferingStrings {
const val FETCHING_OFFERINGS_ERROR = "Error fetching offerings - %s"
const val FETCHING_PRODUCTS = "Requesting products from the store with identifiers: %s"
const val FETCHING_PRODUCTS_FINISHED = "Products request finished for %s"
const val BUILDING_OFFERINGS = "Building offerings response with %d products"
const val CREATED_OFFERINGS = "Offerings object created: %s"
const val JSON_EXCEPTION_ERROR = "JSONException when building Offerings object. Message: %s"
const val LIST_PRODUCTS = "%s - %s"
const val EXTRA_QUERY_PRODUCT_DETAILS_RESPONSE = "BillingClient queryProductDetails has returned more than once, " +
Expand Down