From 77d9146c446b384748352405f79693cc921cbb50 Mon Sep 17 00:00:00 2001 From: eunhak Date: Fri, 7 Jun 2024 23:49:40 +0900 Subject: [PATCH] test: test --- src/components/pwa/Test.tsx | 14 +++++++------- src/pages/sign/index.tsx | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) 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()}
- {/* */} +
);