简体   繁体   English

监听数据库插入并将推送通知发送到android设备

[英]listen to database insert and send push notification to android devices

i want to send push notification to all my devices when there is an insert into table. 当插入表格时,我想向我的所有设备发送推送通知。 i successfully developped a php script to send push notification.Now, i want to know how to detect the insert into one of my table. 我成功开发了一个php脚本来发送推送通知。现在,我想知道如何检测插入到我的一张桌子中。 i'm asking for ideas.NB: leater this script will be executed in a cron mode. 我在征求意见。请注意:此脚本将在cron模式下执行。

There are two solutions I can think of: 我可以想到两种解决方案:

  • Make a thread that does a select after an x amount of time. 使线程在x的时间后执行选择。
  • Use Sockets, so on the server side it sends a message to the client after a successful insert into the database. 使用套接字,因此在服务器端,在成功插入数据库后,它将向客户端发送一条消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM