diff --git a/src/components/pwa/Test.tsx b/src/components/pwa/Test.tsx index dc9ca0d..98fa36a 100644 --- a/src/components/pwa/Test.tsx +++ b/src/components/pwa/Test.tsx @@ -1,21 +1,21 @@ import { useEffect } from 'react'; import { registerServiceWorker, - requestNotificationPermission - // sendPushNotification + requestNotificationPermission, + sendPushNotification } from './SetUp'; export const Test = () => { // 푸시 알림 테스트 - // const clickPushHandler = () => { - // // sendPushNotification('매직포스 알림', '알림 가나요?'); - // }; + const clickPushHandler = () => { + sendPushNotification('매직포스 알림', '알림 가나요?'); + }; useEffect(() => { registerServiceWorker(); requestNotificationPermission(); // 직접 푸시 알림 테스트 - // sendPushNotification('테스트 알림', '테스트 알림입니다.'); + sendPushNotification('테스트 알림', '테스트 알림입니다.'); }, []); - // return 알림 보내기; + return 알림 보내기; }; diff --git a/src/pages/sign/index.tsx b/src/pages/sign/index.tsx index 613b815..ef1a579 100644 --- a/src/pages/sign/index.tsx +++ b/src/pages/sign/index.tsx @@ -4,7 +4,7 @@ import SignInButton from '@/components/shared/sign/SignInButton'; import SignUpButton from '@/components/shared/sign/SignUpButton'; import Link from 'next/link'; -// import useSendPush from '@/components/pwa/UseSendPush'; +import useSendPush from '@/components/pwa/UseSendPush'; import { getTokenHandler } from '@/components/pwa/Fcm'; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; @@ -23,7 +23,7 @@ const SignHomePage = () => { /* eslint-disable */ const [FcmToken, setFcmToken] = useState(''); - // const sendPush = useSendPush(); + const sendPush = useSendPush(); // useEffect(() => { const fetchToken = async () => { @@ -40,7 +40,7 @@ const SignHomePage = () => { fetchToken(); }, []); - // console.log(FcmToken); + console.log(FcmToken); return ( @@ -75,7 +75,7 @@ const SignHomePage = () => { {Test()} - {/* { sendPush({ title: `알림테스트`, @@ -85,7 +85,7 @@ const SignHomePage = () => { }); }}> fcm 테스트 - */} + );