skip to Main Content

I have an offline first app with premium subscriptions, how can I keep the subscription offline? Currently what I do is save the expiration date and every time the application starts I check if this date has not expired yet. But this has the vulnerability that if the user changes his date on the device he can take advantage of this.
Additionally, every time you connect to the Internet, I check if you still have your subscription active and update the date. But I still have that vulnerability. Any idea how to do it? Thank you

2

Answers


  1. you can use flutter’s secure storage, in which the user does not have access, I would save the date in this safe place and implement a logic using this data, that way it does not matter if the user changed the date, next link
    flutter_secure_storege

    Login or Signup to reply.
  2. We are using ntp package for getting correct time from a device. Of course the package needs to be online to checked. But the package also has vulnerabilities. The way we get correct time for each device is worldtimeapi. You need to know timezone of user and check only datetime from this api. When you are offline I think there is no way that you can evaluate if time is correct.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search