Search code examples
androidsubscriptionverification

android verify subscription validity from app every time (dayli) online and offline without a personal server


The problem: I have an app that is provided in subscription. The user may or may not have an internet connection after they have purchased it. I need to check the status of the subscription from the app but without a support server. It is strongly advised not to use API access directly from the app. How the hell do I warn the user that the subscription has expired and need to renew it so that it may block the use of the application? I'm studying API OAuth2.0 access to use Purchases.subscriptions in my app so I can periodically check my subscription status and block the application if it's over, but I have a lot of difficulty implementing it. I also thought about putting an alarm in the app so that when the subscription expires notice the user who needs to renew it (I have already implemented the purchase libraries for the purpose) but that means saving data on the user's device and I do not like . All the tips are well accepted.


Solution

  • If you don't plan to use a back end server, then you have to use API access directly from the app as you mention...there really is no way around it. I do think it is annoying that it is not easier to get basic subscription expiration information more easily for smaller developers who are not going to be running a backend server.

    Without calling the API, you can get the autorenew boolean value from the purchase object to know if the subscription has been cancelled or not. However you won't have the expiration date with is pretty important.

    I'd say that if your app is not going to be a crazy popular one that others will try to reverse engineer then you can take the chance to call the API from within the app to get the detailed subscription information. Also, saving data about the subscription should be fine in sharedpreferences on the user device.

    Please share how it's been going for you so far.