简体   繁体   中英

time limit android application

I created an android application that has Firebase as the back-end and everything's working fine, from registration to authentication... but I need to add a feature where the user can only push A button once every 10 days for example. Now I used the sharedPreferences method which does the trick but it only sets the limit per application, in this case a user can uninstall and re-install his application and he would bypass this "time limit". I need to know if there's any function, a cloud function per-say, that limits the button click per registered user like for every user there's his proper time limit no matter if he uninstall and re-install the app or use another phone. Each Firebase user = proper time limit.

obviously information about button click (timestamp?) should be stored outside device, as app may be re-installed as you noticed. so you need some storage API, a server-side

if "registered user" is registered using Firebase Authentication then you may use also Firebase Storage or even better Realtime Database for storing infos about clicked buttons tied to particular users

PS. be aware that Firebase isn't free , well, not every component... web/mail auth is fully free, but sending SMS costs, so is limited in free plan. Storage have more limitations, like traffic or size limit, so be awared that if your app will spread around you may be forced to move to "blaze plan"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM