InAppBillingPlugin

Cross-platform In App Billing Plugin for .NET


Project maintained by jamesmontemagno Hosted on GitHub Pages — Theme by mattgraham

Testing and Troubleshooting

Integrating and testing In-App Purchases is not an easy task and should go through a lot of testing. I have attempted to simplify the integration part, but the app store side is a bit trickier. Here are my tips and tricks on each platform:

iOS Testing & Troubleshooting

Ensure Contracts are Signed

You will not be able to test any StoreKit functionality until you have an iOS Paid Applications contract – StoreKit calls in your code will fail until Apple has processed your Contracts, Tax, and Banking information.

How to test purchase from TestFlight

Android Testing

<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>KeystoreLocation</AndroidSigningKeyStore>
<AndroidSigningStorePass>PASS</AndroidSigningStorePass>
<AndroidSigningKeyAlias>ALIAS</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>PASS</AndroidSigningKeyPass>

Android Troubleshooting

Windows Testing & Troubleshooting

Turning on Testing Mode

Windows.Services.Store has no simulator, so the plugin includes an in-memory one. Nothing is persisted between runs and no money is involved. Add your catalog and turn on InTestingMode:

#if WINDOWS
var simulator = InAppBillingImplementation.Simulator;
simulator.AddProduct("gold", ItemType.InAppPurchase, "Gold", 4.99m);
simulator.AddProduct("potion", ItemType.InAppPurchaseConsumable);
simulator.AddProduct("coins", ItemType.InAppPurchaseConsumable, storeManagedQuantity: 100);
simulator.AddProduct("monthly", ItemType.Subscription, hasTrial: true);

// Optionally force a failure for the next purchase
simulator.NextPurchaseStatus = WindowsStorePurchaseStatus.NetworkError;
#endif

CrossInAppBilling.Current.InTestingMode = true;

Testing mode doesn’t show any Store UI and doesn’t need a packaged app. Make sure it is off in release builds.

<= Back to Table of Contents