-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
65 lines (51 loc) · 1.71 KB
/
index.js
File metadata and controls
65 lines (51 loc) · 1.71 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
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
/**
* @format
*/
import {AppRegistry, Text, TextInput} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import {Amplify} from 'aws-amplify';
import config from './src/aws-exports';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import PushNotification from "react-native-push-notification";
import messaging from '@react-native-firebase/messaging';
import * as amplitude from './AmplitudeAPI';
import AmplitudeInit from './AmplitudeAPI';
import * as Sentry from '@sentry/react-native';
Amplify.configure(config);
/*
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background!', remoteMessage);
});
messaging().getInitialNotification(async remoteMessage => {
console.log('Message handled in the kill state!', remoteMessage);
});
*/
PushNotification.configure({
onRegister: function (token) {
console.log("TOKEN:", token);
},
//알림을 클릭하면 실행됨
onNotification: function (notification) {
console.log("NOTIFICATION:", notification);
},
popInitialNotification: true,
//requestPermissions: Platform.OS === 'ios'
requestPermissions: true
});
PushNotification.createChannel(
{
channelId: "MoodMemo_ID",
channelName: "MoodMemo"
}
)
Sentry.init({
dsn: 'https://3554b53489972dd0d1159d97e9cc6eb7@o4505669151555584.ingest.sentry.io/4505669208375296',
});
AmplitudeInit();
amplitude.beginSession(); // 앱 시작
Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.allowFontScaling = false;
TextInput.defaultProps = TextInput.defaultProps || {};
TextInput.defaultProps.allowFontScaling = false;
AppRegistry.registerComponent(appName, () => App);