I just started trying to add IAB (In-app Billing) support to my Android app. I purchased a plugin from the Asset Store, so implementation has been pretty painless. Surprisingly, it seems to be testing my implementation that’s the most annoying. Wondering if I might be doing something wrong or if Google has just decided to make this difficult.
My complaints:
- Can’t test w/ developer account - So, I am publishing my app using my personal Google account as the developer. You would think that I could use that same account to test and use the app. You would think that Google would recognize “Oh, this is the developer… just approve all IAB requests w/ no charges made”. Instead, everything is denied and I have to test with a completely separate account. Maybe not a big deal for a company, but this sucks for a one man project. So, now I either need to get a device from a friend, or I need to create a new account and manage switching between multiple Google accounts on my personal device.
- Can’t test w/o publishing - I had hoped that I could just build directly from Unity to my device and test IAB that way. But from what I’ve read that doesn’t work. I also can’t test a Draft version of the app either. So, I have to actually publish a test app to either my Alpha or Beta group just to test any sort of IAB. Worse, publishing says it may take an hour or before it propagates out. Are you telling me I need to wait an hour between each IAB change to even test it? That seems ridiculous!
Am I missing something? Or is this Just The Way It Is?
You certainly can test with your developer account, have you added it to the Testers emails?
Also, you aren’t required to use Alpha & Beta groups, you can have a draft sitting in production and can test the in app purchases. So long as they have been published.
Hmm… no I didn’t add the dev account to the list of Tester accounts because I saw this on the License Testing page:
"In addition to the owner of this console the following users will get the License test response from the application. They can also make in-app purchases from APKs that have been uploaded but not been published yet. "
It sounded like the dev account was assumed. But when I attempt to purchase an item w/ the dev account, I get this error back from the Google servers:
“The publisher cannot purchase this item”
But if you’re saying that you have been able to make test purchases w/ your dev account then maybe I should try adding it to the list anyway to see what happens.
I think the draft thing may have recently been changed. It seems Google now requires you to publish your app:
http://developer.android.com/google/play/billing/billing_testing.html#draft_apps
Wow, I hadn’t noticed that change. That is frustrating.
Just finished chatting w/ Google Support and they clarified a bit. Thought I would note what they said for posterity (and my future reference).
They said that there is currently no way around the requirement to use a non-developer account to test IAB purchases.
However, they showed me how I could quickly test IAB changes w/o having to publish each changed APK to the dev console and potentially wait an hour or more for the change to propagate. The key is not that you must publish every APK you test to the dev console but that you must publish some APK to the dev console.
So, let’s say my current APK published to the dev console has a version code of 3 and I want to add IAB support. I need to add IAB support, increment the version code to 4, and then upload the new APK. It may take an hour or so for Google Play to register that version 4 is authorized to process IAB transactions. But after that, I can continue locally building APKs with version code 4 as much as I want and they will work immediately without having to publish or upload each APK or in fact do anything to the dev console. I’ve since confirmed that this does indeed work. Then, once I’m done with IAB implementation and testing I just upload and publish a finalized APK w/ version code 5 (b/c Google requires version code increment w/ each upload).
For IAB testing, Google just requires that the version code of the APK you are testing on your device matches the version code of the APK in the dev console. It doesn’t care if the APK is different as long as the version codes match.
That was great news and will mean huge time savings for me. The developer account restriction still seems dumb to me, but I’m really happy about finding out about the version codes.
while i feel your frustration. i have been there myself. yes google requires at least 1 apk be uploaded to google play (in a non-released state) to test any IAP functionality. at that point it must be done from a different account then the developer account and must have a credit card linked to it (even though all test purchases are free)
annoying yes, but once you know…
At least they are free now, in the early days it would charge you and you were required to refund the purchases.