Android Question How to call / trigger a sub from php

mare1980k1

Member
Licensed User
Longtime User
Hi, I would like to make an app that sends sms messages when the php requests so. The best I figured was to put a timer that checks mysql database in search of new messages to be sent. And when it sends the sms from the database, then it writes 1 in a field to mark it as sent. But I will be using a lot of time and resources if I check the whole database every 5 seconds even if there are no changes, the same goes with html pages. Is there some way to parse some data from web server to app itself without the app actively checking for the data, but rather as a "post" to the app?

Thank you so much for response :)
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Sounds like a mistake how you are working.

I suggest to implement FirebaseMessaging in your app.

When a message arrive with a specific data then you can fetch data if you need or send a sms.

Send a FCM Message to the device from php and add specific data you need if you want.
 
Upvote 0

mare1980k1

Member
Licensed User
Longtime User
It seems that I will combine the firebase with mysql, or go directly to firebase. Thank you DonManfred :)
 
Upvote 0
Top