Honestly you need something to constantly monitor your app ,and you code write your own logic for that (a hassle indeed). Currently I just use rasp,
this is the one I use:
https://www.talsec.app/freerasp-in-app-protection-security-talsec