Report transactions in Observer Mode in Kotlin Multiplatform SDK
In Observer mode, the Adapty SDK can’t track purchases made through your existing purchase system on its own. You need to report transactions from your app store. It’s crucial to set this up before releasing your app to avoid errors in analytics.
Use reportTransaction to explicitly report each transaction for Adapty to recognize it.
Don’t skip transaction reporting!
If you don’t call reportTransaction, Adapty won’t recognize the transaction, it won’t appear in analytics, and it won’t be sent to integrations.
If you use Adapty flows & paywalls, include the variationId when reporting a transaction. This links the purchase to the flow or paywall that triggered it, ensuring accurate analytics.
import com.adapty.kmp.Adapty
Adapty.reportTransaction(
transactionId = "your_transaction_id",
variationId = product.paywallVariationId // the AdaptyPaywallProduct the user bought
).onSuccess {
// Transaction reported successfully
}.onError { error ->
// handle the error
}Parameters:
| Parameter | Presence | Description |
|---|---|---|
| transactionId | required |
|
| variationId | optional | The string identifier of the variation. Pass the paywallVariationId of the AdaptyPaywallProduct the user bought. It’s the same value as the variationId of the AdaptyFlowPaywall that contains this product. |
In Observer mode, the Adapty SDK can’t track purchases made through your existing purchase system on its own. You need to report transactions from your app store. It’s crucial to set this up before releasing your app to avoid errors in analytics.
Use reportTransaction to explicitly report each transaction for Adapty to recognize it.
Don’t skip transaction reporting!
If you don’t call reportTransaction, Adapty won’t recognize the transaction, it won’t appear in analytics, and it won’t be sent to integrations.
If you use Adapty flows & paywalls, include the variationId when reporting a transaction. This links the purchase to the flow or paywall that triggered it, ensuring accurate analytics.
import com.adapty.kmp.Adapty
Adapty.reportTransaction(
transactionId = "your_transaction_id",
variationId = paywall.variationId
).onSuccess {
// Transaction reported successfully
}.onError { error ->
// handle the error
}Parameters:
| Parameter | Presence | Description |
|---|---|---|
| transactionId | required |
|
| variationId | optional | The string identifier of the variation. You can get it using variationId property of the AdaptyPaywall object. |