-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (29 loc) · 1.12 KB
/
index.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
import React, { useEffect } from 'react';
import { AppRegistry } from 'react-native';
import { PersistGate } from 'redux-persist/integration/react';
import { Provider } from 'react-redux';
import App from './App';
import { name as appName } from './app.json';
import { Store, persistor } from './Src/redux/store';
import PushNotification from 'react-native-push-notification';
import messaging from '@react-native-firebase/messaging';
import PushNotificationConfig from './Src/config/PushNotificationConfig';
import SplashScreen from 'react-native-splash-screen';
const Application = () => {
useEffect(() => {
SplashScreen.hide();
}, []);
return (
<Provider store={Store}>
<PersistGate loading={null} persistor={persistor}>
<App />
</PersistGate>
</Provider>
)
};
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background! inside index', remoteMessage);
PushNotification.localNotification(remoteMessage);
});
PushNotificationConfig.congigurations()
AppRegistry.registerComponent(appName, () => Application);