Skip to content

Commit

Permalink
feat : 알람 메인화면에서 받기
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWook committed Dec 8, 2024
1 parent 41aea68 commit 5c8743f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: postamn
on:
push:
branches:
- develope
- chore-firebase-빌드-에러-수정-

jobs:
deploy:
Expand Down
14 changes: 14 additions & 0 deletions public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
importScripts("https://www.gstatic.com/firebasejs/8.7.1/firebase-app.js");
importScripts("https://www.gstatic.com/firebasejs/8.7.1/firebase-messaging.js");

firebase.initializeApp({
apiKey: "AIzaSyBodJm9QErZvWuaOdM6Af1H82LA-8ZcmhE",
authDomain: "fcm-test-51b74.firebaseapp.com",
projectId: "fcm-test-51b74",
storageBucket: "fcm-test-51b74.firebasestorage.app",
messagingSenderId: "10805910843",
appId: "1:10805910843:web:e88131c7c1ef503822eb1e",
measurementId: "G-FXC5BWDC6G",
});

const messaging = firebase.messaging();
3 changes: 3 additions & 0 deletions src/pages/Home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useEffect, useState } from 'react';
import { useGetRecommendLetter } from '@/hooks/useGetRecommendLetter';
import { useGetRecentRelyLetter } from '@/hooks/useGetRecentRelyLetter';
import { TopButtonContainer } from '@/components/HomePage/TopButtonContainer/TopButtonContainer';
import { usePushNotification } from '@/hooks/usePushNotification ';

export type ReplyLetter = {
type: 'MAP' | 'KEYWORD';
Expand All @@ -35,6 +36,8 @@ export const HomePage = () => {
setOpen(false);
}

usePushNotification();

const {
// data: recommendedLetterData,
refetch: refetchRecommendedLetters,
Expand Down

0 comments on commit 5c8743f

Please sign in to comment.