-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
36 lines (30 loc) · 1.11 KB
/
App.tsx
File metadata and controls
36 lines (30 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {SafeAreaProvider} from 'react-native-safe-area-context';
import Navigation from './src/navigation/navigation';
import React, {useEffect} from 'react';
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import messaging from '@react-native-firebase/messaging';
import {NavigationContainer} from '@react-navigation/native';
const queryClient = new QueryClient();
function App(): React.JSX.Element {
useEffect(() => {
// 백그라운드 메시지 핸들러 설정
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
console.log('Message handled in the background!', remoteMessage);
});
// 포그라운드 메시지 핸들러 설정
const unsubscribe = messaging().onMessage(async (remoteMessage) => {
console.log('Message handled in the foreground!', remoteMessage);
});
return unsubscribe;
}, []);
return (
<QueryClientProvider client={queryClient}>
<SafeAreaProvider>
<NavigationContainer>
<Navigation />
</NavigationContainer>
</SafeAreaProvider>
</QueryClientProvider>
);
}
export default App;