Is there a way/line of code that you can insert in Android Studio project to auto delete all messages in the android app that are older than let's say 7 days?
I would like to have all messages canceled/deleted after 7 days of when they where seen/read.
Thank you!
You can use the
Mesibo.deleteMessagesOlderThan()
API and pass the number of seconds to delete messages older than. To delete messages older than 7 days (604800 seconds), use:You would want to call this when the app loads or periodically in a background service, for example,
This will automatically clean up older messages without any additional coding.
For older mesibo API versions, you can use
Mesibo.deleteMessages(ts)
instead and pass the timestamp from 7 days ago.Refer to the https://docs.mesibo.com/api/messaging/deleting-and-recalling-messages/
You may also use disappearing messages if desired
https://docs.mesibo.com/api/messaging/disappearing-messages/