If I were to build a snapchat equivalent mobile app, how could I use the Firebase Storage security rules to delete an image after 24 hours?
I didn't think it was possible but it was briefly mentioned by a Firebase employee in this Firebase video
If I were to build a snapchat equivalent mobile app, how could I use the Firebase Storage security rules to delete an image after 24 hours?
I didn't think it was possible but it was briefly mentioned by a Firebase employee in this Firebase video
There is no way to automatically delete files (or perform any other action) from your security rules. What you can do is make the files (or node in the database) inaccessible after a certain time.
See this answer for an example of this: Firebase security rule to prevent customers from circumventing usage tracking
There's a good example of this in the Firebase Storage reference documentation:
allow read: if request.time < resource.createdAt + duration.value(1, "h");
Hat tip to Mike McDonald for pointing that one out. :-)