lib_unity_purchase/Samples~/Google Play Store - 02 Rest...
刘涛 3b87d20391 全部提交 2024-01-29 18:49:33 +08:00
..
.sample.json 全部提交 2024-01-29 18:49:33 +08:00
README.md 全部提交 2024-01-29 18:49:33 +08:00
README.md.meta 全部提交 2024-01-29 18:49:33 +08:00
RestoringTransactions.cs 全部提交 2024-01-29 18:49:33 +08:00
RestoringTransactions.cs.meta 全部提交 2024-01-29 18:49:33 +08:00
RestoringTransactions.unity 全部提交 2024-01-29 18:49:33 +08:00
RestoringTransactions.unity.meta 全部提交 2024-01-29 18:49:33 +08:00
UserWarningGooglePlayStore.cs 全部提交 2024-01-29 18:49:33 +08:00
UserWarningGooglePlayStore.cs.meta 全部提交 2024-01-29 18:49:33 +08:00

README.md

README - In-App Purchasing Sample Scenes - Google Play Store - Restoring Transactions

This sample showcases how to use the Google Play Store extensions to restore transactions. This allows users to be granted Non-Consumable and Subscription products they already own after reinstalling the application.

Instructions to test this sample:

  1. Have in-app purchasing correctly configured with the Google Play Store.
  2. Configure a non-consumable product.
  3. Set your own product's id in the InAppPurchasing game object > Restoring Transaction script > No Ads Product Id field or change the noAdsProductId field in the RestoringTransaction.cs script.
  4. Build your project for Android and make sure the GooglePlayStore is selected*.
*You can change the currently selected store under Services > In-App Purchasing > Configure and changing the Current Targeted Store field.

Restoring Transactions

When a user reinstalls your application they should be granted any Non-Consumable or renewable Subscription products they already own. App stores maintain a permanent record of each user's Non-Consumable and renewable Subscription products which Unity IAP can retrieve.

On the Google Play Store, Unity IAP automatically restores any products the user owns during the first initialization following reinstallation; the ProcessPurchase method of your IStoreListener will be called for each owned item.

See the documentation on the topic for more information.