데이터베이스의 사용자 목록에 알림을 보내고 싶습니다. 특정 사용자 (웹)에게 브라우저 알림 보내기
나는 푸시 알림을 보낼 수있는 솔루션을 발견 :// request permission on page load
document.addEventListener('DOMContentLoaded', function() {
if (!Notification) {
alert('Desktop notifications not available in your browser. Try Chromium.');
return;
}
if (Notification.permission !== "granted")
Notification.requestPermission();
});
function notifyMe() {
if (Notification.permission !== "granted")
Notification.requestPermission();
else {
var notification = new Notification('Notification title', {
icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
body: "Hey there! You've been notified!",
});
notification.onclick = function() {
window.open("https://stackoverflow.com/a/13328397/1269037");
};
}
}
(출처 : Chrome desktop notification example) 내가 특정 사용자에게 특정 통지를 보내도록 구성 할 수 있습니까? 테이블 user_notification의 모든 사용자에게 알림을 보내려한다고 가정 해 보겠습니다. 내가 코드에
<?php
$sqx = "SELECT * FROM `user_js` ";
?>
를 사용하여 시도했지만 도움이되지 않습니다 중 하나
@JayBlanchard 나는 동의하지 않는다. 나는 이것을 '특정 코딩 문제'라고 생각한다. 난 그냥 어떻게 구성 해야할지 모르겠다 –
내가 이것을 "너무 광범위하게"라고 표시했을 때 질문에 코드가 없다. –
@JayBlanchard .. 양해 해 주셔서 감사합니다. 이제 해결책을 찾도록 도와 주시겠습니까? –