How to clear cache or clear data berore starting native app?

Hello everyone, Currently, I'm building a native app that uses restAPI to get data from the server. I'm having trouble trying to pass the user's login token value into the API. I create a persistable entity to get those token values ​​and get them when I need them. However, when the user logs out and back in, the token value is not updated. I have tried calling a microflow in nanoflow to delete data but it doesn't work well on native app. How to clear all data before starting the application or clear the cache before logging into the application. That error I get when exporting APK runs on real device. But when I running debug is fine. Someone please help me. Thanks!
1 answers

Instead of a delete, you could use a boolean attribute like 'isDeleted' to invalidate your token when the user logs out. That way you won't get sync issues and if you use it as a constraint in the navigation profile, the token won't be synced to the device when a user logs in again.