-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
42 lines (33 loc) · 1.03 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
31
32
33
34
35
36
37
38
39
40
41
42
//import './wdyr'
import 'react-native-gesture-handler'
import './src/actions/interceptors'
import { AppRegistry, Platform } from 'react-native'
import { name as root } from './app.json'
import React from 'react'
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import App from './App'
import messaging from '@react-native-firebase/messaging'
import {store, persistor} from './store'
// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log("remote message: ", remoteMessage)
});
let isheadless = false
if (Platform.OS === 'ios') {
messaging().getIsHeadless().then(isHeadless => {
isheadless = isHeadless
})
}
const NativeApp = () => {
if (isheadless)
return null
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<App />
</PersistGate>
</Provider>
)
}
AppRegistry.registerComponent(root, () => NativeApp)