Y yuval Member Licensed User Longtime User Aug 31, 2016 #1 hi, i want a php page on a web server (joint account) to notify a b4j program running locally, or if possible to notify a b4a app. how is the best way to do this ? register a url in web database, and the php page opens a socket with this url ? thanks.
hi, i want a php page on a web server (joint account) to notify a b4j program running locally, or if possible to notify a b4a app. how is the best way to do this ? register a url in web database, and the php page opens a socket with this url ? thanks.
Erel B4X founder Staff member Licensed User Longtime User Aug 31, 2016 #2 Unless the network is specifically configured for incoming connections then it is not possible. You should use push notifications to notify your Android application. You can use FirebaseNotifications. It should be simple to convert the B4J code that creates the request to PHP. Sending a notification to a desktop application will be more difficult. If you were using a B4J server then you could have implemented a solution based on web sockets. Such as this one: https://www.b4x.com/android/forum/threads/custom-websocket-based-push-framework.40272/#content Upvote 0
Unless the network is specifically configured for incoming connections then it is not possible. You should use push notifications to notify your Android application. You can use FirebaseNotifications. It should be simple to convert the B4J code that creates the request to PHP. Sending a notification to a desktop application will be more difficult. If you were using a B4J server then you could have implemented a solution based on web sockets. Such as this one: https://www.b4x.com/android/forum/threads/custom-websocket-based-push-framework.40272/#content
Y yuval Member Licensed User Longtime User Aug 31, 2016 #3 thanks for your fast fast response !! Upvote 0
techknight Well-Known Member Licensed User Longtime User Aug 31, 2016 #4 Only other way I know is polling. the app polls the server for "updates" using HTTPutils every so often. And the server will need a script specifically for that. Upvote 0
Only other way I know is polling. the app polls the server for "updates" using HTTPutils every so often. And the server will need a script specifically for that.
Y yuval Member Licensed User Longtime User Aug 31, 2016 #5 yes, but i dont want polling, i cant poll the server too much, and if i have 100 k users, it is too much. and even if i have one app , and i want it responsive, i cant poll every 10 seconds. Upvote 0
yes, but i dont want polling, i cant poll the server too much, and if i have 100 k users, it is too much. and even if i have one app , and i want it responsive, i cant poll every 10 seconds.