public function listUsers(){ die("Error failed to connect to MySQL: " . `id` int(11) NOT NULL, } Thank you!!! echo json_encode($array);
}; The push notifications are useful to update user’s with specific news, chat, new email and time bound information like offers etc.
Loop (time)
notifikasi.close(); } if (!empty($_POST['username']) && !empty($_POST['pwd'])) {
Add New Notification:
$isSaved = $push->saveNotification($msg,$time,$loop,$loop_every,$user); } Hi beautiful example, it works great! Very nice script, easy to adjust for my needs, Thank for your time and work PHPZAG TEAM . if (isset($_POST['submit'])) { } else { Step4: Broadcast Notification The error was that used the http Protocol, and it is necessary https. public function __construct(){ Sorry, the script works but push notification does not appear, what could be the reason? To register a service worker, first check for support, then call the register() method. Thanks! When you want to send a push message to your users you need to make an API call to a push service. if(isset($_POST['msg']) and isset($_POST['time']) and isset($_POST['loops']) and isset($_POST['loop_every']) and isset($_POST['user'])) { return $this->getData($sqlQuery); }
foreach ($user as $key) { Learn how push notification can be implemented in php. if(!$result){
For
`publish_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, $array['result'] = true; thanks! } else { `notif_loop` int(11) NOT NULL DEFAULT '1',
) ENGINE=InnoDB DEFAULT CHARSET=latin1; Step2: Create User Login
Loop Every (Minute)
The user can also define interval time for the next notification to be displayed.
User Login:
"; Muito bom o código, funcionou perfeito no computador, mas no celular ele não notifica. private $user = 'root'; SESSION_START(); $push->updateNotification($key['id'],$nextime); $nextime = date('Y-m-d H:i:s',strtotime(date('Y-m-d H:i:s'))+($key['notif_repeat']*60)); }); $notifList = $push->listNotification();