this is more of a logic question. So I’m building up an app that requires 30 days trial period mechanism. What would be the right way to do this?
I’m relying on Flutter/Firebase to do this!
This is how I’m planning to do it but not sure if that is correct way to do it
Adding the field named “free_trial” (boolean) in the firebase and setting it to true initially
Now I need to make that field false once the user crossed the 30 days trial period! How to do this logic?
Let's assume, this is a registration page and once the user signed up, there will be a field inserted in the firebase database which would be "free_trial" and it will be initially set to true
CollectionReference users = FirebaseFirestore.instance.collection('users');
users.add({
"free_trial": true
});
How to make it false once the user has crossed 30 days period. What logic/algorithm would be required to achieve this? like fetching today date and then checking against registration date (something like this)
Any help would be appreciated