Google IAP Heads UP

I’ve spent the past couple days trying to figure out why the IAP products I’d set up for my unplublished app suddenly stopped working, even though I hadn’t touched the previously working code.  I keep getting “invalid” products returned when I query the store with store.loadProducts, even thought the products were working fine a few days ago.

After a live chat session with a support person at Google I learned that some time over the last week they changed the requirements for testing IAP.  His words:

We recently made a change to how testing works for in-app purchases, OBB files, and licensing that requires an app to be published to test.

So, how are we supposed to test IAP on apps that aren’t published yet?

 We’re currently recommending that you upload to alpha or beta to test these features.

Currently I don’t believe this change is documented, although he said

We’re working to update our documentation to reflect these changes.

Unfortunately, since I already set up a production version to test with, if I publish it will send my still unfinished app straight to the Google Play store!  There doesn’t seem to be a way to only publish a beta without triggering the publishing of the production version.  He suggested that

Since you already have an app in production, I would say reupload you app as a new app with a different package name just for testing purposes.

EDIT:  This seems like wrong info.  As long as the production version is unpublished, uploading a beta version removes the production version.  Then publishing the beta should make it available for IAP testing.

That is going to be messier than it sounds since, beyond the new license key, keystore, app number, and product SKU IDs I need to change throughout my code just to create a new test app, I also have dozens of leaderboards and achievements set up in the current app that I guess would need to be duplicated.

Not sure what I’m going to do at this point, but wanted to share what I was told in case other people are in the same boat and having troubles testing their Google Play IAP in an unpublished app. 

-Stephen

>> troubles testing their Google Play IAP in an unpublished app.

I had just figured it out a couple days ago. I had a draft (unpublished) production, but IAP wouldn’t work against it (using separate test account, listed as a tester, published IAP’s, etc - everything else set up correctly) I uploaded a beta APK and published it, had my tester acct jump through all the hoops and got it downloaded, and test iap’s (real ones, but no charge) just worked.

>> There doesn’t seem to be a way to only publish a beta without triggering the publishing of the production version.

Have you tried? Pretty sure all I did was upload a beta and hit publish, and it did what I wanted (and I no longer have a draft production version) Besides, if your next step is is to abandon it entirely, then what have you got to lose by trying? If it somehow publishes your draft production, then I guess you just unpublish the whole thing and abandon it and start over fresh (as per google rep)?

I believe you are right, Dave.  I uploaded the a beta and the production version was automatically removed. The customer support guy told me publishing the beta would trigger publishing the production version but that should not be the case since there is no longer a production version.  Perhaps Google fixed this recently.  I’m publishing the beta now so I guess I’ll know in a few hours if I can beta test the IAP.

Stephen, just wanted to give a big thanks for your post!  I’ve been scratching my head about this exact issue for the past few days (both licensing and IAP suddenly stopped working for an unpublished app).

  • Andrew

Thx for the info! Much appreciated!!!

  • Daniela

Just to update, after a little effort to get a beta version set up and published, and creating a Google group for my test accounts, I’m able to test IAP again.  While it seems to take a few hours for a new version of the beta to propagate through Google’s servers and update my test devices, and doing so requires updating the version code each time, I found that I can still side load new revisions of my app to test changes quickly (I use dropbox to make a new version available to my test devices), without updating the version code and without waiting.

-Stephen      

@dave - Are you sure you didnt get charged? I published my app to “alpha” to test IAP and the purchases were billed to the credit card i used :frowning: i was sure i read that you dont actually get charged while in alpha/beta…

edit: another look at the google doco and it looks like you do get billed in alpha/beta unless you use the specific test iap items that google provides. 

How about testing with android.test items like android.test.purchased and the other test items? Doesn’t that work well?

My understanding is the test items work for early stage exercising of you IAP code, but those simply bypass all of Google’s merchant and user account checking that real IAP requires and they simply return their static responses.  

In terms of google actually charging the credit cards of alpha and beta accounts, I believe that’s true, except for any google accounts you have listed in the Google Play developer console, under settings/account details, as having testing access.  When I make beta purchases from those accounts the item popup messages from Google clearly state that the credit card won’t be charged.

I don’t think the Google docs have caught up with their under-the-hood changes.  It’s made it a bit of a challenge to test IAP lately.  Really hard to know if there’s a problem with my code, Corona’s plugin, or something changing on Google’s side of the wall.

Stephen, thanks for this thread; I thought I was going crazy over here with my IAP work returning the INVALID products.  Now I’m off to upload an alpha…

I will say that in using the version 2 of the Google Play IAP – the one built natively into Corona and NOT the plugin version – credit cards are charged for test accounts.  Though you, as the merchant account holder, can easily go in and cancel the transaction before the credit card is ever charged since it seems to take a day or two before Google actually makes the charge.

If it did charge, you could always refund it as well.

I uploaded an alpha, installed it properly, but I have had the same problem - store.loadProducts() returning the Inactive Products.

I live-chatted with Google and they were no help.  They said that “everything looks good on our end.”

Stephen, were there any other steps that you did? 

I have one possible problem area.  I have a Google Account to test this with, but no Gmail address.  Setting up License Testing in Settings -> Account Details says " Gmail accounts with testing access."  I don’t have a Gmail account, just a Google account with a non-gmail e-mail address.  I thought that might be the problem, but when I logged into my device with the “owner of the console” user, it made no difference.

Thanks for your help.

How long has it been since you uploaded your alpha?  I’ve often had to wait overnight, and Google says it can take up to 24 hours, for a new version to propogate.  Changes made to IAP products from the Google Console seem to take a few hours as well.

If waiting doesn’t fix it, I would try setting up a new gmail account to test with.  You can’t buy or even fake buy IAP using your publisher account so you might as well set up a test account.

there’s potentially two different things going on

gmail account with test access is for licensing.  say you had a paid app in beta, iap’s are charge-free to testers but not the apk itself, so you email your testers a copy and have them sideload it.  ahh, but then they’ll fail your licensing check as the server doesn’t “know” them.  so you grant their account the always ‘licensed’ response.

that’s what that was for.  (or maybe a reviewer, similar)  not really for proper beta-testing.  if you iap based on that permission alone you WILL be charged - all you did was bypass the licensing test, but you’re still running a “real” app with “real” purchases.

the way you’re supposed to do alpha/beta-testing of iap’s, is that “manage list of testers” (on apk page) where you authorize a group/community, invite ppl to join it - those transactions DON’T (or, shouldn’t ; ;)) get charged.

Thanks you two.

I uploaded the app several days ago, along with the IAP Items.  I successfully loaded that (alpha) version onto my device.  I also have added my personal Google Account to the list of testers via a Google Group, and that’s all working.  I am still encountering the problem whereby I only see the inactive items in the active (event.products) table. 

Dave, thanks for the explanation about how the Licensing setup works.  That makes sense.  While I was live-chatting with a Google person, they said that I had to setup the list of testers in the Alpha/Beta channels, but I ALSO had to set up the testers in the Licensing area so that the store would work properly for them. 

I’ll keep trying things.

Success!  I found the problem - I was calling event.products[i].price and in Google In-AppV3, that field does not exist.  .localizedPrice does exist, and that is the one that I needed anyway.

Now I am just wondering why something I marked as an Inactive product in Google is being returned in the valid products list.  The google popup properly says that you can’t purchase it, so I guess that’s the behavior, and I must update my apk when I make those items available for purchase.

Thanks for  all your help.

>> troubles testing their Google Play IAP in an unpublished app.

I had just figured it out a couple days ago. I had a draft (unpublished) production, but IAP wouldn’t work against it (using separate test account, listed as a tester, published IAP’s, etc - everything else set up correctly) I uploaded a beta APK and published it, had my tester acct jump through all the hoops and got it downloaded, and test iap’s (real ones, but no charge) just worked.

>> There doesn’t seem to be a way to only publish a beta without triggering the publishing of the production version.

Have you tried? Pretty sure all I did was upload a beta and hit publish, and it did what I wanted (and I no longer have a draft production version) Besides, if your next step is is to abandon it entirely, then what have you got to lose by trying? If it somehow publishes your draft production, then I guess you just unpublish the whole thing and abandon it and start over fresh (as per google rep)?

I believe you are right, Dave.  I uploaded the a beta and the production version was automatically removed. The customer support guy told me publishing the beta would trigger publishing the production version but that should not be the case since there is no longer a production version.  Perhaps Google fixed this recently.  I’m publishing the beta now so I guess I’ll know in a few hours if I can beta test the IAP.

Stephen, just wanted to give a big thanks for your post!  I’ve been scratching my head about this exact issue for the past few days (both licensing and IAP suddenly stopped working for an unpublished app).

  • Andrew

I’m having the same issue with testing consumables now too - I have all the product ID’s entered into the developer console, and I was uploading an unpublished production version of the apk until I read this, and then uploaded an alpha version  of the apk for testing. 24 hours later, it still says the product ID’s are invalid in the pop-up message we integrated into the app.

Do I need to upload an apk for testing to “Beta” or does “alpha” work for testing in app purchases too?