Android in-app purchase of a subscription with a free trial - how to avoid abuse?

自古美人都是妖i 提交于 2020-07-17 10:15:26

问题


I've searched high and low for guidance on how best to address this... I've read Google Play In-App Subscriptions (http://developer.android.com/google/play/billing/billing_subscriptions.html) and the section on Implementing Subscriptions (http://developer.android.com/google/play/billing/billing_integrate.html#Subs) but I still don't see a way to avoid abuse.

I've also seen the related question here - Google Inapp purchasing and trial period. However, using the SharedPreferences is subject to relatively easy abuse.

I have an app that will require a subscription for full functionality. I set up a monthly subscription in-app purchase product, say ID = "myapp.subscription.monthly", costing $0.99/month. I want to give people a chance to experience the full functionality, so I give "myapp.subscription.monthly" a 30-day trial period.

When the user installs the app for the first time, they are prompted to purchase the monthly subscription, they are charged $0.00 and told that starting 30 days from now their card will start getting charged $0.99/month.

When my app calls "getPurchases()", the fact that they have a subscription will be returned.

If they cancel during the free trial, or say after a couple of months of billing, a call to "getPurchases()" returns nothing, according to the "Implementing" section:

The call returns a Bundle with all the active subscriptions owned by the user. Once a subscription expires without renewal, it will no longer appear in the returned Bundle.

Since the user has no active subscriptions, my app will prompt them to purchase the subscription for full functionality. Again, they will get the 30-day free trial.

I've thought about having a second subscription product, say "myapp.subscription.monthly.no.free.trial" and I would have that be the available item for purchase. However, without a way to ask Google Play if the user ever previously purchased a subscription, my app can't know that is should be offering the "no free trial" product.

So, how to avoid someone just subscribing and cancelling over and over to keep getting the free 30 days? Is there a way to ask Google Play for the complete purchase history?


回答1:


According to documentation (https://support.google.com/googleplay/answer/2476088?hl=en, Trial subscriptions), its says:

You can't sign up for multiple trials.

I guess Google automatically handle this




回答2:


Google Play Store handles this automatically

If your user cancels the free trial and then tries to make a purchase, he/she will be shown the $0.99 rather than giving a Free trial again. But, if the user pays the $0.99 after canceling the free trial, the actual billing will only start after the canceled Free trial period has ended.

It would have been helpful if there was any way to know whether a product has a free trial or not on the client side. Hope that will be put into the In-App Billing API soon.




回答3:


I am also using in app billing but google always provide one free trial per user. If u subscribe same sku again then google will not provide trial period to that user.



来源:https://stackoverflow.com/questions/25612177/android-in-app-purchase-of-a-subscription-with-a-free-trial-how-to-avoid-abuse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!