FRONTENDSCHOOL6 / ready-act

멋쟁이사자처럼 파이널프로젝트 16조
MIT License
0 stars 4 forks source link

[R09M App] 알림 - 기능 구현 방법 문의 이슈 #55

Closed jellyjoji closed 1 year ago

jellyjoji commented 1 year ago

내용

저희가 만든 “공구룸” 웹앱 서비스에서 알림 기능을 구현하려고 합니다.

포켓베이스 리얼타임 기능을 활용하면 푸시 알림 기능을 구현할수 있을것 같은데 푸시알림에 대한 자료를 검색하면 firebase 관련 자료밖에 나오지 않아서 알림 기능 구현 방법에 대해 문의합니다.

찾아본 푸시 알림 자료

[Kakao Developers](https://developers.kakao.com/docs/latest/ko/push/rest-api)

[React에서 Browser Notification (푸시 알림) 구현하기](https://mingule.tistory.com/68)

[Notifications API Standard](https://notifications.spec.whatwg.org/)

function NotificationSender() { const [message, setMessage] = useState('');

const sendNotification = async () => { try { const response = await fetch('YOUR_POCKETBASE_API_URL/send-notification', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_AUTH_TOKEN', }, body: JSON.stringify({ message }), });

  if (response.ok) {
    console.log('Notification sent successfully');
    // 여기에서 필요한 처리를 수행하세요.
  } else {
    console.error('Error sending notification:', response.statusText);
  }
} catch (error) {
  console.error('Error sending notification:', error);
}

};

return (

Send Notification