Restoring Purchases
Learn how Deepwall manages restoring purchases
Last updated
Learn how Deepwall manages restoring purchases
Last updated
Deepwall SDKs restore in-app purchases for both subscriptions and non-subscription products, and validate user receipts for you without the need for additional code.
Whenever users restore from the displayed paywall, Deepwall gets latests receipt and validates.
Deepwall sends purchase events for you to handle and take necessary actions in your app workflow.
Deepwall SDK triggers restore events which gives you the ability to manage restore flow in your app.
Whenever a restore is successful even there is active purchase or not, Deepwall sends a purchase success event.
Deepwall sends the deepwallPaywallPurchaseSuccess
event for iOS and PAYWALL_PURCHASE_SUCCESS
event for Android whenever a restore is successfully and receipt has been verified. All purchased subscriptions and non-subscription products are returned as parameter.
You can recognize and handle the restore event by checking the validation type parameter:
RESTORE: If the validation type is RESTORE
, this means a restore request is successfully validated. In this case, you can close the paywall if the user is a paid subscriber and also you can make the necessary updates for paid users in your app.
Event for Restore Fail
Whenever a restore fails due to an error, the Deepwall iOS SDK sends a restore fail event and the Deepwall Android SDK sends a purchase fail event.
Deepwall sends the deepwallPaywallRestoreFailed
event for iOS and PAYWALL_PURCHASE_FAILED
event for Android whenever a restore request has failed due to an error.
Restore Cancelled by the User: If a restore is started and the user does not provide account credential and approve the restore, then the event is sent with isPaymentCancelled
parameter TRUE
.
Restore Failed Due To Error: If isPaymentCancelled
is FALSE
, this means restore has failed due to an error. Restore can fail because there is no receipt to validate or due to an error. Deepwall returns the error codes and text as a parameter.
You can check out the following guide to learn more about listening to all the SDK events and parameters:
You can also check out the following guide for troubleshooting the most common errors while setting up the in-app purchases and Deepwall SDK :
iOS Event
Android Event
deepwallPaywallPurchaseSuccess
Parameters :
type: PloutosValidationType
result: PLPurchaseResponse
subscriptions: Array of SubscriptionItem
products: Array of ProductItem
PAYWALL_PURCHASE_SUCCESS
Parameters :
SubscriptionResponse
type: DeepwallReceiptValidationType
result: SubscriptionDetail
subscriptionArray of PurchaseSubscriptionItem
products: Array of String
iOS Event
Android Event
deepwallPaywallRestoreFailed
Parameters :
reason: RestoreFailedReason
.noReceipt
.failed
errorCode: String
errorText: String
isPaymentCancelled: Bool
PAYWALL_PURCHASE_FAILED
Parameters :
SubscriptionErrorResponse
type: DeepwallReceiptValidationType
result: DeepwallPurchaseFailedInfo
productCode: String
reason: String
errorCode: String
isPaymentCancelled: Bool