Troubleshooting Guide
Common issues organized by category. Each entry includes the symptom, likely cause, and step-by-step fix. Use the search above to find specific error messages.
SDK Initialization
Store Credentials & Webhooks
Store Issues
Paywall Display
Purchase Flow
Push Notifications
Sign-in & Sessions
Canonical PurchaseResult Mapping (v1.4)
When implementing a custom PurchaseController, you must map store-specific outcomes correctly. Misclassifying cancellations or pending states breaks downstream funnel analytics and entitlement reconciliation.
| Result | When to surface it | Never surface as |
|---|---|---|
| purchased | Store confirms a new transaction successfully. | — |
| restored | Transaction resurfaces via the restore flow / transaction logs. | purchased |
| cancelled | User dismisses the purchase sheet (e.g. StoreKit userCancelled, Google Play USER_CANCELED). | failed |
| pending | Awaiting external action (e.g. iOS Ask-to-Buy / SCA, Android PENDING cash payment). | failed |
| failed(error) | Terminal failure with a typed error (should be wrapped in BillDogError). | — |
Why cancellation is not a failure
Showing an error dialog or toast on user-initiated cancellation is a top-3 cause of paywall churn and skews purchase_failed analytics. The SDK will emit a purchase_cancelled analytics event instead of purchase_failed for the .cancelled case.
Error Mapping Example
Wrap underlying SDK errors into BillDogError rather than passing them through raw:
do {
// BillDog.shared.purchase(...) returns a typed PurchaseResult;
// cancellation and pending are result cases, never thrown errors.
let result = try await BillDog.shared.purchase(productId: productId)
switch result {
case .cancelled: return .cancelled // never surface as failed
case .pending: return .pending // Ask-to-Buy / SCA / Android PENDING
default: return result
}
} catch {
// Wrap any raw thrown error into a typed BillDogError.
return .failed(error: (error as? BillDogError) ?? .customError(error.localizedDescription))
}Was this page helpful?
Or rate this page: