Search code examples
androidgoogle-playin-app-purchasein-app-billing

Best way to start an app in Free or Pro mode


I have an Android app and I also offer 1 inapp purchase to unlock such app to the Pro version.

I know how to do use the inapp purchase API and such but I found discordant ways on how to check if the app should start as Free or Pro.

Many people suggest that after a successful purchase the app should store the Google Play receipt or other information in a local database and let the app check the presence of that information at startup (in order to start properly as Free or Pro)

My question is, instead of bothering saving the purchase information and retrieving it from a local database why not calling the restore purchase API RestorePurchases(), have a look at the returned object if the InApp item is present and unlock the app accordingly?

As far as I know the call doesn't require internet connection, it's just a local call to the local Google Play authority... am I missing something?


Solution

  • Let me explain how we manage it at QuitNow!, an app with the same behavior than yours.

    We only have one SKU called unlock_all_pro_features. If the user has it, it means that the user bought the PRO features before.

    So, in the Android side, everytime the app is started we try connecting to IInAppBillingService. When onServiceConnected() is called, we ask it for all the user owned SKU's. If it has our lovely SKU, we store in a SharedPreference that the user was a PRO one. And then, if it wasn't PRO before doing all this magic, we update the screen to show the brand new features.

    Bad things there: the user can return the SKU!

    To face that, when we consider that a user was a PRO one, we also ask if the user has the needed SKU. If that check fails 20 times, we reset the features to the FREE version.

    Why checking it 20 times instead of just one time? Sometimes, we found that the service said that the user had any SKU, while he actually had the PRO one. Why? Don't know. So, checking it 20 times is a simple way to assure that we don't kick PRO users when unneded.