Week 4 of Building Pocketflow for Shipaton 2026: Storage, Push Alerts & Navigation
This week, we focused on making Pocketflow robust and navigatable. As AI image and video processing takes time, users cannot stay glued to the screen.
We set out to solve four major problems:
- Saving media files persistently on device storage.
- Alerting users via push notifications when generations complete.
- Preventing users from getting lost in our infinite Compose canvas.
- Caching cloud files locally to fix blank asset screens on login changes.
ASSETS
Persistent Storage
When an image or video is generated, it comes down as raw bytes. Saving these in temporary directories is a recipe for data loss. Using Kotlin Multiplatform platform-specific implementations, we mapped a persistent file writer to the native documents directory:
// Save bytes to native documents directoryval fileName = "pocketflow_media_${UUID.randomUUID()}.$extension"val file = File(context.filesDir, fileName) file.writeBytes(bytes)
Cloud Asset Caching
When a user logs out and logs back in on a new session, their local cache is cleared. The...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE