0

I've got a general question regarding in-app billing and checking strategics:

I have several apps and I would like to offer them for a trial time with full features (14 days) and then charge a fee to use it. I would like to follow the http://developer.android.com/guide/market/billing/billing_best_practices.html and check the signature on my own SQL server. There are good examples, see Android in-app purchase server signature verification using php OpenSSL

My Idea is the following, (correct me if this is not possible):

  1. start App and contact to google server to obtain user ID (account which installed the app from google Play
  2. with that ID contact my SQL server (sending ID and App name), if not existing create entry with date in order to check Trial period, and obtain Public Key, trial period and so on
  3. with the Public Key contact google Server and check state of inapp-purchases for that user
  4. update the app according to google answer (full features, trial period valid/expired)

Is that a good approach?

Are there some good examples to do this? I looked up the forum, there are approaches but, not that one.

Many thanks,

Community
  • 1
  • 1
user1616685
  • 1,310
  • 1
  • 15
  • 36
  • I think one challenge is going to be obtaining an ID for the user that persists across devices and installs. – DrC Mar 18 '13 at 16:36
  • Is there no way to retrieve the User ID of an installation? unique is as well the email address. – user1616685 Mar 18 '13 at 17:58
  • I'm not aware of an id from Google Play that is constant across installations. There may be something outside the in-app-purchase APIs though. – DrC Mar 18 '13 at 20:22
  • Maybe that one ? http://stackoverflow.com/questions/6850196/google-accountmanager-android?rq=1 – user1616685 Mar 19 '13 at 06:40
  • Looks interesting - I had only used the IAP stuff so wasn't aware of it. – DrC Mar 19 '13 at 06:43
  • Or that one. http://stackoverflow.com/questions/12361006/how-can-an-application-server-associate-google-accounts-to-a-users-device?lq=1 – user1616685 Mar 19 '13 at 07:00

1 Answers1

0

I am not very sure if it is possible form inapp purchase, but you can do one thing, suppose you have an item which is available for purchasing, create a timer or some kind of counter, and check for your specified trial period, if(inTrialPeriod){ don't show any purchasing option just give them free from your app with different item id) else(show the item purchase option from google play).

Amitabh Sarkar
  • 1,281
  • 1
  • 13
  • 26
  • Hi thanks for Your Answer, I can imagine that, but what do You mean by "just give them free from your app with different item id"? Is that possible? Maybe a weak spot to trigger lifetime trial on rooted devices? I would like to implement the SQL server as well in order to avoid manipulation on rooted devices. How about the general approach? Device - google -Device - SQL -communication? – user1616685 Mar 18 '13 at 10:10
  • Google offers trial periods as well: http://developer.android.com/google/play/billing/v2/billing_subscriptions.html#trials somebody has experience with that? – user1616685 Mar 18 '13 at 11:01