android / play-billing-samples

Samples for Google Play In-app Billing
Apache License 2.0
2.38k stars 1.34k forks source link

In-app purchases with multiple accounts #2

Closed TonyTangAndroid closed 7 years ago

TonyTangAndroid commented 8 years ago

Hey there, there will be issue when users have multiple accounts added in device. This is an issue that everyone who has ever integrated android play billing is experiencing. Please refer to this link https://plus.google.com/+ChrisLacy/posts/BAahtLEw9gy or this link for more details. http://stackoverflow.com/questions/28811490/in-app-purchases-with-multiple-accounts#

KimiChiu commented 6 years ago

I have a little question. What if people share their accounts to different people? I mean, the accounts which have a lot of purchased items. They just need to add these accounts to their phone and use the app which only get paid for once. I think this is why the google billing api doesn't query every item from all the accounts. But it is confusing to the users. That's why I'm here.

dmota-systango commented 6 years ago

@abumoallim I have the similar problem as of yours. Did you find any solution for it? Please let me know.

Thanks in advance!

abumoallim commented 6 years ago

There is no solution did I able to find for this thread. I tried each and every case but the problem is purchased product is related to primary email ID .

On Wed, Jan 17, 2018 at 1:57 PM, Deepti Mota notifications@github.com wrote:

@abumoallim https://github.com/abumoallim I have the similar problem as of yours. Did you find any solution for it? Please let me know.

Thanks in advance!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-billing/issues/2#issuecomment-358254238, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKf_z64-yFUzIfrt1--qozsu-cQs0uSks5tLcQEgaJpZM4HAyHj .

bumbaras commented 6 years ago

(...) What if people share their accounts to different people? I mean, the accounts which have a lot of purchased items. (...) Well, it will always be a dilemma how to make good balance beetween protection rights and customers convenience. But should Google Play Store mechanism treats everyone as a potential thieves? Do you want to treat a customer who shared one paid app with own brother in the same manner as a dirty thief who is selling "on his account" on Aliexpress paid apps to many buyers around the world and earning money? I don't know anyone among my friends who shared their personal play account to others, especially strangers. If You think about steam example - that is totally different story. I know there are cases of selling stolen apps, but it will stay that way independently if google allow or not multi accounts purchases because it is distributed totally different way than sharing one full account.

KimiChiu commented 6 years ago

@bumbaras I don't think Google Play Store is treating them as "thieves". But querying every item from all the accounts is definitely not a good solution. If they want to share their items, they should use the "Family Sharing" feature. If the app doesn't support it yet, they just have to buy it again. Just like the Blue rays, if we bought it, we could lend it to anyone. But we can't have another copy. That's why the copy protection exists. Do those film studios treat us like thieves? I don't think so. And the "dirty thief" don't even need to sell "on their account". They just need to create a new account for sharing. But that's not the point. We programmers are not just make the problem disappeared, we resolve it.

bumbaras commented 6 years ago

I understand Your point but the biggest here is that google can't verify if I am the owner of both devices and all for example three accounts belong to me or not. And there are two methods for purchasing and verifying if You are legitimate user or not. The first, older - You can purchase app directly in play store and only requirement to validating You is an correct account with correct password on Your devices. Password verification is doing when app is installed directly from shop. If You sideload such app password verification is omitted. The second method - in app-purchase. This time having correct account on device is not enough - it has to be main account, and changing main accounts means a factory reset (there is other unofficial method for that but the results differ, and mostly play store is broken after that). So in the second case, If I have a habit to have separate account for each device i am treating as a thief because app-purchase won't authorize paid apps from other accounts.

And KimiChiu - i am well aware of this disadventage now, so I have changed my habit and all my devices have the same main account. But I wasn't aware of that in the past, lucky I didn't make a inapp purchase on two different devices. But I am pretty sure there are guys who did that way.

MFlisar commented 6 years ago

I see this problem quite regularly, maybe around 1% of my users have this problem and I've read from others with approximately the same percentage...

My fast solution would be to allow the developer to decide if he wants to query the main account only or all. Because imho I'm not wasting my time on making my apps hacker safe and therefore I don't care about those few people who would misuse this and I would just like to be able to query all accounts.

Currently all users blame the app (not the play store and it's in app purchase handling) and in the end, this makes more damage than a few people stealing an app...

casolorz commented 6 years ago

Personally I think a 1 star review is much worse than a user stealing 2 or 3 dollars. So I would rather this issue go away in a way that makes the users happy.

Currently what I do is provide several ways for my users to contact me if the app doesn't think they have the in app purchase but the user thinks they do. After I verify their purchase and ask them if they have multiple accounts then I give them a free code. I'm sure some have abused this policy but at least the 1 star reviews because of this issue have gone down.

abumoallim commented 6 years ago

I think the only solution to this problem is if google link purchase in connection to email through which we are downloading app or purchasing rather than associating always with primary account.

And we can query google about the particular purchase with email ID as a parameter

On 31 Jan 2018 19:06, "casolorz" notifications@github.com wrote:

Personally I think a 1 star review is much worse than a user stealing 2 or 3 dollars. So I would rather this issue go away in a way that makes the users happy.

Currently what I do is provide several ways for my users to contact me if the app doesn't think they have the in app purchase but the user thinks they do. After I verify their email and ask them if they have multiple accounts then I give them a free code. I'm sure some have abused this policy but at least the 1 star reviews because of this issue have gone down.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-billing/issues/2#issuecomment-361959473, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKf_6otlBMO1XqNwKcYV2czDuNEdLISks5tQIECgaJpZM4HAyHj .

casolorz commented 6 years ago

Or let us present to the user a list or accounts and the user chooses which one to use. Play music lets me select an account. Don't see why we can't have the same.

abumoallim commented 6 years ago

Issue is with getting the product too. While checking any product there should be option for a particular Email id rather than just automatically taking primary account

On 1 Feb 2018 09:35, "casolorz" notifications@github.com wrote:

Or let us present to the user a list or accounts and the user chooses which one to use. Play music lets me select an account. Don't see why we can't have the same.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-billing/issues/2#issuecomment-362163753, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKf__z7BU2DQDBOTJQUcKYzOKnL6jAUks5tQU0egaJpZM4HAyHj .

ciceromsjr commented 6 years ago

I had to use Firebase and save some data about the user's purchase. Then, I check first on Firebase if the user has purchases. It works fine. For me it's very clear that regardless which account is selected on Google Play Store, if the purchase owner one is present on the device, the purchases should be restored. Users don't care about it. If they purchased they just want to use it. They don't have to do anything, any workaround, to get their purchases.

casolorz commented 6 years ago

If you don't mind me asking, what kind of data are you saving? I'm getting a bit tired of waiting for a solution to this issue.

ciceromsjr commented 6 years ago

My app requires login first all. When the user buy some product I save it on Firebase and I can check it whenever I need to. The only way it would fail is if the user log in with different account but he has one his device the account which he has used to buy the product. In this case I check using the common way (Google's approach). It's really rare, but it's possible. I haven't had any problem so far.

dmota-systango commented 6 years ago

@ciceromsjr Could you please share any reference link or the code to let me directly know that common way (Google's approach)?

Thanks in advance :)

ciceromsjr commented 6 years ago

The common way I mentioned is the way you probably already do:

https://developer.android.com/google/play/billing/billing_library.html

You have to check wether the purchase is cancelled or refunded to remove the user access if you store this information on your own server (or Firebase as I do).

In other cases, you don't have to do this.

dmota-systango commented 6 years ago

Thanks, @ciceromsjr for sending the details!

I am using https://github.com/googlesamples/android-play-billing for billing/ purchase management. Which is working absolutely fine for the payments and related updates for the primary account of the device.

But, my app is having an option to switch between accounts (similar to all Google apps like Gmail) and the one I am using, doesn't have any option to specify the email to get the purchase details.

Is the library you are specifying, https://developer.android.com/google/play/billing/billing_library.html, gives an option to get purchase details of any secondary/ other emails?

netomarin commented 6 years ago

@dmota-systango the methods for Android in-app billing (including the Play Billing Library) doesn't have the option to specify the user. The purchases are always related to the user that was selected on Play Store app when you installed the app. So, if an user A installs the app, all purchases will be done on it's account, even if you have the account selector in your app.

We are working to improve this experience, but unfortunately we don't have an ETA for this feature. Thanks

dmota-systango commented 6 years ago

ok :(

But thanks for the updates, netomarin!

abumoallim commented 6 years ago

I think the best or the simplest solution will be instead of querying directly through the Primary account. There should be an option of passing email id while querying the product.

@dmota-systango
Even I am using Firebase for saving about which user purchased the product and which has not on the same phone. You can use any server to save that thing about user purchase. But Unfortunately, the problem will still persist when another person on the same phone tries to purchase the product.

dmota-systango commented 6 years ago

@abumoallim Yes, absolutely agree with you.

@netomarin I feel you are from Google dev team. So, thought to check this case for my app. And I found a very strange behavior by InApp getPurchase() method. I picked up two accounts, A with one purchase and B with no purchase. When I synced these accounts in the device and triggered getPurchase() from my app, it always returns back the response related to A (which has one purchase), irrespective of which account is selected in play-store app and the account is primary one (tried with removing first and add it at second position).

Very shocked after seeing this. This has failed all my logic. Can't we find the email in response of getPurchase() method, at-least to link the purchase with corresponding account only?

dmota-systango commented 6 years ago

@ciceromsjr I am also storing the purchase details in Firebase for later verifications. I hope, you are also storing the email along with.

Could you please verify? And if the answer is yes then how do you find that email and how do you verify purchase later? Please help me to come out of this headache.

ciceromsjr commented 6 years ago

When the user selects an account to log in I know the email he used.

When he buy some product I do not do anything yet. I wait twenty days (this is arbitrary) after his purchase an then I store his e-mail and some other data on Firebase. I wait this time to avoid keeping access to users that has cancelled their purchases.

If an user ask me for refund I remove his purchase data from Firebase.

If you don't have the user's email until his log in on your app, you can simply do nothing and pray for Google Play to not remove his access.

After the user log in on your app, you can take this approach.

dmota-systango commented 6 years ago

My bad :( We do not have login option in our app. We are just using GoogleSignIn.

Thanks!

ciceromsjr commented 6 years ago

But with GoogleSignIn you can get user's e-mail, can't you?

So you could use it to take the approach I've mentioned.

dmota-systango commented 6 years ago

Yes, you are correct. GoogleSignIn also gives me user's email and I am following similar approach as of yours after fetching it.

But, my app also has an option to switch between their accounts like other Google apps, Gmail etc. So when the email changes, need to get payment details related to new email. Which InApp billing is not supporting.

You might also be facing similar problem when user Logs-In with a different account. I mean, other than primary or accounts in device, no?

ashughes commented 6 years ago

@abumoallim @dmota-systango @ciceromsjr I disagree. Not all apps have accounts or Google sign-in. Google Play Billing is supposed to manage purchases on behalf of the app and shouldn't require knowledge of the Google accounts on the device to function properly.

I've advocated that purchases from ALL accounts on the device be returned when querying for purchases. However, another option might be to provide an API that the app can call to let the user choose which account they want to use. This would be transparent to the app and wouldn't require it to know about accounts on the device.

Realistically, the only time a user should need to use this account picker is if they installed the app with the wrong Google account selected in the Play Store (rather than having to uninstall and reinstall the app with the correct account selected). This is assuming the bug ever gets fixed where the Google account used by the Play Store is switched after an app update, which is a huge source of "missing purchases" issues for users.

I'm not saying the API to query purchases based on email address shouldn't exist (I see how this would be useful for apps that have the ability to switch between multiple accounts), but this should not be the primary solution to this problem.

casolorz commented 6 years ago

I'm with @ashughes on this, although querying by email would also be useful. I just don't understand why all these options aren't available already. I've been dealing with this issue for like 4 years with zero progress.

ciceromsjr commented 6 years ago

@ashughes I totally agree with you. Obviously what I did is a workarround but I think Google should be the responsbile for this.

In my case it helped a lot. I was getting a lot of emails about users losting theirs purchases ever update I released.

MFlisar commented 6 years ago

I would like to be able to get purchases for all accounts as well but sadly it does not work.

In some Google discussion I read the reason for this. It's to secure us developers. Think about following use case: one user buys a lot of apps and sells access to his account to others. Everyone could now add this users account as an alternative user account to his phone and would get access to all apps bought by this account. If I remember correctly this is something common for steam users and a big problem. So I somehow understand why it is the way it is...

Although personally I would prefer better user satisfaction instead of more security... or at least the ability to optionally check all accounts instead of the main one only

ashughes commented 6 years ago

@MFlisar While I understand what you're saying, I certainly hope that's not the reason. While I'm sure this is somewhat common for small groups of people who know each other (e.g. families), this can't possibly be common for large groups. When you add a Google account to a device, you have access to the ENTIRE account: email, Drive, etc., plus all the payment methods associated with that account. That means if someone was using a shared account and added their payment method, then anyone would be able to use it. As I said, this makes complete sense for families and close friends, but not on a large scale. As a developer, I'm totally fine with people using shared accounts in this way. Of course, there are other ways to support this use case (like Google Play Family Library, but that only works with paid apps, not in-app purchases or subscriptions, except for Google Play Music).

bumbaras commented 6 years ago

I see that the thread directed to copyrights cases. I am really happy that these all folks who are now decisive in copyrights matters didn't live in the past - we still would have a stone age in 2018 AD. Or maybe it would be better for Mother Earth? Who knows ...

dmota-systango commented 6 years ago

@ashughes I think, you misunderstood us. We didn't require email to fetch payment/ billing details, while wanted it for verification instead. So that no false payment gets linked to false user/ account in our app.

As, neither we can request purchase details of specific email nor the purchase details and representing which email it belongs to. I hope, now I am able to make our problem/ target clear.

dmota-systango commented 6 years ago

@netomarin Did you get time to analyze the problem I specified here?

casolorz commented 6 years ago

Any updates? I had a user leave 5 reviews today because of this, yeah 5! They even emailed me to tell me about it, they apparently have 7 accounts.

Artaud commented 6 years ago

Just got a funny email regarding this problem - to quote the customer:

Google support says to contact the app developer to get this resolved even though all of my paid apps have this issue.

Yeah I understand Google will lose their money when people don't have to buy each of their apps 40 times.

chrisjenx commented 6 years ago

Holy Guacamole still can't believe this is an issue! I haven't done IAP for a while - only saving grace is that at least Google doesn't force you to use their service unlike Apple. I'll just role Stripe, damn sight cheaper too!

Artaud commented 6 years ago

@chrisjenx Unfortunately that's not possible for premium features (as I would need) as "Google's developer terms require that purchases related to the app, such as premium features or credits, are made via their native In-app Billing API. You can only use Stripe for purchasing physical goods (such as groceries, clothing, and appliances) or for services (such as club memberships, hotel reservations, and tickets for events)."

chrisjenx commented 6 years ago

Oh that changed. Never used to be like that.

Then this really needs to get fixed, pathetic that this has been going on for 2+ years now.

On Mon, 21 May 2018 at 10:02 Jiří Richter notifications@github.com wrote:

Unfortunately that's not possible for premium features (as I would need) as "Google's developer terms require that purchases related to the app, such as premium features or credits, are made via their native In-app Billing API. You can only use Stripe for purchasing physical goods (such as groceries, clothing, and appliances) or for services (such as club memberships, hotel reservations, and tickets for events)."

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-billing/issues/2#issuecomment-390699403, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHRsSxXCgn5mVoZZ71k0Q_TUR0NFgMnks5t0uUfgaJpZM4HAyHj .

casolorz commented 6 years ago

Way longer than 2 years, my app is over 4 years old and has had this issue from the beginning.

abumoallim commented 6 years ago

Are you telling me that google changed its term and condition ? And now it is like apple that You need compulsory in-app native google billing for giving in-app features ?

It will be a big issue then.

On Mon, 21 May 2018, 20:27 casolorz, notifications@github.com wrote:

Way longer than 2 years, my app is over 4 years old and has had this issue from the beginning.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-billing/issues/2#issuecomment-390706919, or mute the thread https://github.com/notifications/unsubscribe-auth/AOKf_4gtGN-PZz6-RUc4BTNMlGqn9_V_ks5t0usNgaJpZM4HAyHj .

Artaud commented 6 years ago

@abumoallim @chrisjenx They introduced that back in 2013. About as long as this issue stands.

https://play.google.com/about/monetization-ads/payments/ http://www.bgr.in/news/google-bans-third-party-in-app-payment-providers-from-android-play-store/

Artaud commented 5 years ago

Any news @netomarin ? This is still a complete nightmare. This issue consumes about a hour on support for me every day. That's a really expensive bug on your part...

mat90c commented 5 years ago

+1

TonyTangAndroid commented 5 years ago

Welcome to 2018 and it is still being reported periodically, which makes me : (

Michoko92 commented 5 years ago

It is also 99% of our user support job every day. What a nightmare! As ashughes said above, we simply need to receive all purchases from all installed accounts, not just the active one. It's really a pain to explain to our users how to fix this issue: sometimes we send a redeem code (but of course, depending on the active account, it doesn't work), sometimes we refund the users. And we regularly get bad reviews and bad reputation about this issue. Please fix it!!

Artaud commented 5 years ago

I believe we need to get someone from the appropriate team. @netomarin could you please point us to the relevant person? I've mentioned this previously to our business dev advocate at Google but she's just for EMEA, while this is definitely a global issue and needs some attention. Should I still go through her or could you suggest someone else?

casolorz commented 5 years ago

This has been an issue since I started using in-app purchases, I think it was on 2014. I've lost all hope it will ever be fixed, which is insane considering this actually makes Google money, you would think they would have people always working on it to improve it.

ashughes commented 5 years ago

@netomarin @pfmaggi Any update on this? Last I heard the hope was to have this fixed by the end of 2018, but that has now come and passed. Any new details would be appreciated.

AhmMhd commented 5 years ago

i think we have a workaround to this issue using a server by checking whether a user's subscription purchase is valid. Ref: https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get

passing the subscription token will return the expiry date and we can add subscription validation from the response we get from our server.