Testing is one of the most important stages of implementing Unity In-App Purchases (IAP). Before releasing your game, every purchase flow should be thoroughly tested to ensure products are configured correctly, purchases complete successfully, rewards are granted properly, and restoration works as expected.
This guide explains how to test Unity IAP on Android and iOS using Google Play Internal Testing, TestFlight, and sandbox environments.
Complete the previous guides before continuing:
- Introduction
- Prerequisites
- Install Unity IAP
- Unity Gaming Services
- Create Products
- Consumable Purchases
- Non-Consumable Purchases
- Subscriptions
- Restore Purchases
- Receipt Validation
A successful implementation is more than simply displaying a purchase button.
Before publishing your game, verify that:
- Products load correctly
- Prices display correctly
- Purchases complete successfully
- Rewards are granted correctly
- Restore Purchases works
- Subscriptions activate correctly
- Error messages are user-friendly
- UI updates correctly after purchases
Testing helps identify issues before your players encounter them.
For Android, Unity IAP should be tested using Google Play Internal Testing.
Typical workflow:
Create Internal Testing Release
│
▼
Upload APK or AAB
│
▼
Add Test Users
│
▼
Install From Play Store
│
▼
Test Purchases
Always install the game from Google Play rather than directly from a local APK when testing purchases.
For iOS, use TestFlight together with Apple's Sandbox environment.
Typical workflow:
Upload Build
↓
App Store Connect
↓
TestFlight
↓
Invite Testers
↓
Install Game
↓
Test Purchases
TestFlight allows subscription renewals and purchase restoration to be tested before release.
Never test purchases using a real payment account.
Instead:
Use:
- License Testers
- Internal Testing Track
Use:
- Sandbox Apple ID
- TestFlight Testers
Sandbox purchases simulate real purchases without charging money.
Verify every product individually.
Examples:
- Coins
- Gems
- Energy
- Hints
Confirm:
- Purchase succeeds
- Rewards are granted
- Multiple purchases work correctly
Examples:
- Remove Ads
- Premium Upgrade
- Unlock All Levels
Confirm:
- Purchase succeeds
- Content unlocks
- Purchase restores correctly
- Purchase button disappears after ownership
Examples:
- VIP Membership
- Monthly Pass
- Premium Membership
Confirm:
- Subscription activates
- Premium content unlocks
- Renewal works (sandbox)
- Expiration behaves correctly
- Restoration succeeds
Players won't always complete purchases successfully.
Verify handling for:
- Payment cancelled
- Network failure
- Invalid Product ID
- Billing unavailable
- Store temporarily unavailable
Your game should display helpful error messages and continue functioning normally.
Verify purchase restoration by:
- Purchasing a non-consumable
- Reinstalling the game
- Restoring purchases
- Confirming premium content unlocks
Repeat the process on multiple devices when possible.
If your game validates receipts:
Verify that:
- Valid receipts succeed
- Invalid receipts fail
- Duplicate receipts are rejected
- Rewards are granted only after validation
Run tests under different conditions:
- Online
- Offline
- Slow internet
- Device restart
- App restart
- Multiple purchases
- Interrupted purchases
Testing different scenarios helps identify edge cases before release.
Before publishing your game, complete the following checklist:
- All products load correctly
- Prices display correctly
- Consumables work
- Non-consumables work
- Subscriptions work
- Restore Purchases works
- Receipt validation works
- Failed purchases handled
- UI updates correctly
- Player data saves correctly
- No Console errors
- No purchase duplication
Avoid these common issues:
- Testing with a local APK instead of a store-installed build
- Using real payment accounts
- Forgetting to activate products
- Product IDs don't match
- Testing only one product
- Ignoring failed purchase scenarios
- Not testing restoration
Before releasing your game:
- Test every Product ID.
- Test on multiple devices.
- Test both Android and iOS.
- Keep debug logging enabled during testing.
- Remove unnecessary debug logs before publishing.
- Record purchase failures to simplify troubleshooting.
A thorough testing phase significantly reduces post-launch issues.
Your purchasing system is now implemented and tested.
The next guide covers Best Practices, including clean architecture, project organization, security recommendations, and maintenance tips for production-ready Unity IAP implementations.
You can also jump to any section of the guide: