19

Typical scenario, user has two accounts, [email protected] and [email protected], both on their Android device. The user buys my premium upgrade on version 1.0 using account [email protected], then they update to version 1.1 and the code (the in-app purchases code) now thinks they are using account [email protected], so it thinks the user hasn't bought the premium upgrade. I know it is using the wrong account because they send me their order email and then they tell me the wrong email is listed on the buy dialog if they press on the $ amount. The only fix at this point is to uninstall and reinstall using the Play store desktop website and the right account.

I am using the IABHelper from the sample with some fixes from StackOverflow. As far as I know there is no way for me to even choose the account they are using for that.

Any ideas on what might be going on? has this happened to anyone else?

The code exceeded the length limit at StackOverflow so I've put it here http://pastebin.com/hLquZ6SP

EDIT: I now have a user who claims this happens to him every time he updates the app.

EDIT: This happens a lot more during staged rollouts, I think because the account that gets the staged update is not the one the user bought the IAP with.

11
  • 1
    the code sample should be part of your question, and not be added answers
    – Kai
    Apr 27, 2015 at 2:19
  • "The user buys my premium upgrade on version 1.0 using account [email protected], then they update to version 1.1 and the code now thinks they are using account [email protected]" --> Could you elaborate the logic implication here?
    – Sebastiano
    Apr 30, 2015 at 20:06
  • The user installs the app. The user has two gmail accounts (xyz@g... and abc@g...) in their android device. They buy my premium in-app purchase features and the app version is 1.0. The premium features are bought typically under whichever account they used to install the app, let's say xyz. I'm not even sure whether I can control that. Then I release an update, 1.1, and when the user opens the app again, the app now thinks they are using account abc and they haven't bought the premium features. The only way to fix it is to uninstall and reinstall using the website version of the play store.
    – casolorz
    Apr 30, 2015 at 20:14
  • I should add that this is happening to a small fraction of my users, a tiny fraction I would say but then I'm guessing the amount of people with two gmail accounts on their device is also tiny. Of my over 15k sales I only get 5 or 6 complaints about this on every release.
    – casolorz
    Apr 30, 2015 at 20:17
  • Are you sure you're not mistaken and the users have been using IAP with account abc all along. Honestly I've seen the IAP only going through the first account added on to the device. To purchase in app items I had to remove all the other accounts. May 1, 2015 at 2:19

3 Answers 3

2

This appears to be a bug in the Play Store app. See this Google Help Forum post for a user workaround.

Basically, the Play Store app sometimes associates the wrong Google Account with an app's in-app billing. But it seems to work correctly when the app installation is "pushed" from the Play Store website (from a computer).

One caveat though: In the above linked thread, there's a report of the workaround correcting the account and billing association, but then reverting back to the incorrect Google Account after an app update. So, I'm unsure if this workaround is reliable.

1
  • The workaround works well and I've been having my users use it, I've also just been giving them free promo codes so their other accounts can have my in-app purchase. The problem is that neither solution fixes the problem permanently and only helps those users who contact me, doesn't solve the bad reviews problem.
    – casolorz
    Apr 5, 2016 at 12:49
0

I had same issue with a very small number of users too.

It is impossible to control in the code, which account is used for purchase validation. When this happens I ask users to select the account they bought an in-app extension with in Google Play app, then restart the device, launch application and execute "restore purchase" operation. In most cases this helps. If it doesn't then they need to use Google Play web ui, pretty much how you described it.

I have also to admit, that the most of such issues I experienced back in 2013, beginning 2014, and never since then. Maybe Google improved this in some way.

4
  • Interesting, I didn't actually use to have this issue, I've only started having it on the past two or three updates I've done but I don't know if that was just a lack of a large enough user base or if something has changed.
    – casolorz
    May 2, 2015 at 11:31
  • I just had a user reported this issue to me. So this problem is still there.
    – Kimi Chiu
    Jan 12, 2018 at 9:35
  • @KimiChiu I reported this issue long ago but they have closed it as "won't fix" issuetracker.google.com/issues/36967788 Jan 12, 2018 at 18:42
  • @sergejshafarenka I found another similar question. stackoverflow.com/q/44397765/3109401 Looks like there's an Android team member said that it is underdevelopment.
    – Kimi Chiu
    Jan 13, 2018 at 3:08
0

You have no way to specify in your code which user account will be used for the purchase, because the OS/Google Play decides that:

  • if you download the app from the Play Store using account xyz, then the same account will be the one billed for the purchases related to your app
  • if you install the app again (re-install or other device) using an other account abc then this will be treated as the owner of that app, therefore the purchases from xyz are not visible into abc account
  • if you sideload the apk then the account owning the app will be the first Google account created on the device

To me what you are describing looks more an issue with some customer being played by the way the Google IAP model works. The subtle issue is sometimes users have different active account across devices, so it can be hard to notice you are actually downloading the app using another account.

1
  • I completely agree with the 3 scenarios you described however my users claim that they haven't reinstalled or installed on a new device (though that is a common different issue) but that it was just the new update that caused it.
    – casolorz
    May 2, 2015 at 11:29

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.