android - Get the In app subscription trail period pragmatically. -
i working in android application want implement inapp billing subscription. have created subscription id in google play developer console trail period of 7 days.
my requirement notify user each time remaining days left subscription when app launches. how can trail period left subscription pragmatically. correct way implement inapp billing subscription trail period, if no please suggest me correct way implement this.
yes, in-app billing api version 3 supports trial period! couldn't find whether there api call give kind of details on trial period need in documentation doesn't mean there isn't such class/method.
however, relying on remote google service subscription status means user not notified when not connected network. maybe lack of notification when not on network not problem. but, knowing of limitation, record , keep start date locally, well.
once have captured results of api call allows user start trial period, can save data locally. there 3 'easy' ways keep local data: via preferences (easiest), write local file (a little harder), or setup , populate sqlite db (yet, harder). use preferences time , quite easy.
if want make 'local' data accessible multiple android devices (if subscription scheme supports multiple devices), need put data remote server, instead. and, data @ activity start.
keeping simple - data on local device - read local preference see when trial started, calculate number of days remaining, , present message. use google api call confirm subscription status. in case of conflict, update local preference, accordingly.
with strategy, user can notified @ application/activity launch on trial period time remaining without using google api details of trial period; , bonus, regardless of whether app user on network, or not.
Comments
Post a Comment