android - Per Device subscriptions for purchases through Google Play -
i setup subscription based billing app sold through google play. possible sell same subscription same user on different devices? every device user tries use app on need active subscription?
i thinking store device id , user id on own server , authenticate way, correct user can't purchase same subscription more once? need pool of same subscriptions if user wishes purchase multiple "licenses"? can google play billing handle of natively?
thanks
the documentation google seems make impossible achieve digging deeper, uncovered following...
in google play api version 2.0, create called "unmanaged" product type allowed user purchase same thing multiple times. seems have partly disappeared in api 3.0 although gooogle developer console supports this. assume it's still supported because apps used 2.0 api still out there , google can't drop support that.
in 3.0 however, "unmanaged" product type not listed in api docs docs state following making multiple purchases same product type (one-time purchase or subscription):
if using version 3 api, can consume managed items within application. typically implement consumption items can purchased multiple times (such in-game currency, fuel, or magic spells). once purchased, managed item cannot purchased again until consume item, sending consumption request google play. learn more in-app product consumption, see consuming items
http://developer.android.com/google/play/billing/api.html#consume
important: subscriptions cannot consumed means if want customer periodically renew license, have contact them , tell them must purchase license again. that's downside if service requires periodic renewal.
to obtain after, need backend server handle registration of devices , store tokens apps receive google play when purchasing. when user wants purchase license, feature, service (or whatever) device, other device must first release "ownership" of product google play, through process known "consuming". work more or less this:
- the first device makes purchase , receives purchasetoken string google play.
- the purchasetoken along device id sent app server , stored.
- the user goes second device , wants purchase license device. app first needs go server , obtain purchasetoken (that first device uploaded) , call google play consumepurchase releases "ownership" of product user.
- the app purchases new license (or whatever) google play, gets new purchasetoken , stores on server along device id.
in essence, google play won't keep track of device has product. associates google account product being purchased. it's app , server manage licenses.
there 1 potential problem see need address. if reason app fails send purchasetoken server (your server down, user dropped device , broke it, app crashes before saves token on device, etc.), may not know if user paid service. google provide server api lets backend server query google play on google's server information purchases, i'm not familiar nor limitations.
Comments
Post a Comment