Hi
@walterf25
my understanding is that you problem is mainly due to
where you run the 30 seconds check.
As
@KMatle showed above, having a server (or even a PC running H24..) performing the check, then sending an FCM message to your mobile app will solve it.
I don't know whether you already used B4J, but it won't be that difficult to write a non-UI server program which checks an email account every 30secs, stores locally UIDs and sends out alerts for newer ones only.
As a first attempt, you could use your developing PC as the "server". Once everything is sorted out, just buy a cheap VPS plan and run your own B4J program on it. This is to avoid the PHP part of the above hint since you seems to feel uncomfortable with it. Going the PHP way buys you a cheaper hosting plan (PHP+MySql are standard offerings) while the VPS route will cost a bit more.
One way or the other, the recurring check should be run outside your mobile app.
udg