-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
77 lines (68 loc) · 2.12 KB
/
App.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import React, { useEffect, useState, useRef } from "react";
import { StatusBar } from "expo-status-bar";
import { Dimensions, StyleSheet, View, Platform, Alert } from "react-native";
import Navigations from "./navigation/Navigations";
import * as Font from "expo-font";
import * as SplashScreen from "expo-splash-screen";
import Constants from "expo-constants";
import * as Notifications from "expo-notifications";
import { createStackNavigator } from "@react-navigation/stack";
import { navigationRef } from "./navigation/PushNavigation";
import { useShareIntent } from "expo-share-intent";
import { ShareIntentProvider, useShareIntentContext } from "expo-share-intent";
import { usePushNotifications } from "./usePushNotifications";
import { LogBox } from "react-native";
const Stack = createStackNavigator();
export default function App() {
const [isFontLoaded, setIsFontLoaded] = useState(false);
const notificationListener = useRef();
const responseListener = useRef();
const { expoPushToken, notification } = usePushNotifications();
const data = JSON.stringify(notification, undefined, 2);
LogBox.ignoreLogs(["Warning: ..."]); // Ignore log notification by message
LogBox.ignoreAllLogs(); //Ignore all log notifications
useEffect(() => {
loadFonts();
return;
}, []);
const loadFonts = async () => {
try {
await Font.loadAsync({
Pretendard: require("./assets/fonts/Pretendard.otf"),
Bebas: require("./assets/fonts/Bebas.ttf"),
});
setIsFontLoaded(true);
await SplashScreen.hideAsync();
} catch (e) {
console.warn(e);
}
};
if (!isFontLoaded) {
return null;
}
return (
<ShareIntentProvider>
<View style={styles.container}>
<StatusBar
style="auto"
backgroundColor="white"
barStyle="light-content"
translucent={false}
/>
<Navigations />
</View>
</ShareIntentProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#ffffff",
},
bebasText: {
fontFamily: "Bebas",
},
pretendardText: {
fontFamily: "Pretendard",
},
});