Skip to main content
Solved

POC testing to purchase Subscriptions and In-App Payments with Capacitor


Forum|alt.badge.img+1

Hi there, we are building a simple POC to test In-App Purchases, both Subscriptions and In-App Purchases, for iOS and Android.    

We have successfully tested this on iOS, being able to purchases a Subscription via the app and also performing actions from the device System settings, e.g. to upgrade and/or cancel the test subscriptions, capturing the events via our webhook endpoint.  This was developed and tested, using live reload from Angular/Capacitor, via Xcode with a real device connected via USB.   

I have to say that Apple, with XCode and TestFlight, really do provide a much better platform for developing and testing apps, which Google and Android could really learn from and this leads to our current issue, that being Android.

It seems to a little more confusing, and troublesome with Google. 
We have followed the docs (Google and RevenueCat) and
 created a Closed track in the Play Console, in which we uploaded an initial release build and have defined a list of email addresses for our track testers, both of the Subscriptions created are active, with active base plans; one with a trial.  As this is still very much WIP / beta build for our internal testing of the integration, this build has not been submitted for review by Google, as it is clearly not a build we intend to release.  However, we have a couple of issues:

  1. If we use the links from the How testers join your test in the closed track, we see error message stating that the app is not published;
  2. Running the app in the emulator (via Android Studio) on the developer machine, when we attempt to purchase package via the SDK we get an error of “The product is not available for purchase”
    const result = await Purchases.purchasePackage({
      aPackage: p
    });
    

Apologies, if this has been asked before. but we could not see anything in the community that could answer our questions.  So, can anyone please help with our Android testing questions please:

  1. Can the developer test the purchasing of Subscriptions, or other In-App Purchases, without submitting a release to Google for review?  
  2. Will we see this “The product is not available for purchase” without submitting the closed track version for review!?
  3. Is there any reason why the emulator could not be used for testing purchasing Subscription and other In-App Purchases, if using the latest version of the Play Store and signed in with the tester credentials?  

I know that RevenueCat recommends testing on a real device, but we since upgraded to Capacitor version 7, which was done alongside the RevenueCat SDK install, the live reload seems to have stopped working, i.e. our app loads, but shows a white screen after the splash screen loading the app.  This is clearly a Capacitor or config issue that we’re working on, therefore backing off to the emulator for now.   

Any help is much appreciated, as we would like to validate our POC before moving designing the full implementation for the main app.

 

Cheers,

Paul

Best answer by pthorp

OK, after fixing the issues with Capacitor and Android studio, I can now test on the real device and see that I can purchase the test subscriptions presented.

I am still a confused why an emulator that has the same user logged into the Play Store might give the ‘Product not available’ error?

View original
Did this post help you find an answer to your question?

2 replies

Forum|alt.badge.img+1
  • Author
  • Helper
  • 1 reply
  • Answer
  • March 4, 2025

OK, after fixing the issues with Capacitor and Android studio, I can now test on the real device and see that I can purchase the test subscriptions presented.

I am still a confused why an emulator that has the same user logged into the Play Store might give the ‘Product not available’ error?


jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 240 replies
  • March 10, 2025

Hi ​@pthorp, it’s great to hear that you’ve been able to test on a physical device. While we have been able to test on an emulator, we find them much more flaky and unreliable, which is why we always recommend testing on a physical device. For example, emulators can often lack Google Play Services, or don’t support Billing, or are blocked from testing purchases running unsigned debug builds, or just general emulator/sandbox flakiness. It sounds like you’ve been able to proceed with testing your in-app products, but don’t hesitate to let us know if you run into more issues here - we’re happy to help.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings