Sync Purchase History
#
Sync Purchase History with appmateIf your users had some purchases that performed before you implemented SDK to your project, you will be able to sync this purchase transactions with appmate. This will allows you to see all the purchase records made by this user, this data will be available seen via purchase reports. Additionally, if you want to show all purchase history records of your users, you will able to fetch all purchases after syncing purchase history transactions. See this page to learn how to fetch all purchases. To store users' transaction history, call createPurchaseHistoryTransactions method.
You should send this request only when your application is installed for the first time on a device or when your application has been removed from a device and reinstalled.
The following code demonstrates how to store purchase history transactions to the appmate.
#
RequestParameter Name | Type |
---|---|
purchases | List<PurchaseInfo> |
listener | ReceivedDataListener<Boolean, GenericError> |
#
ResponseParameter Name | Type |
---|---|
onSucceeded | Boolean |
onFailed | GenericError |
- Kotlin
- Java
PurchaseClient.getInstance().createPurchaseHistoryTransactions(purchases, new ReceivedDataListener<Boolean, GenericError>() { @Override public void onSucceeded(Boolean data) { } @Override public void onError(GenericError error) { } });
PurchaseClient.getInstance().createPurchaseHistoryTransactions(purchases, object : ReceivedDataListener<Boolean, GenericError> { override fun onSucceeded(data: Boolean) { }
override fun onError(error: GenericError) { } })