-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (30 loc) · 868 Bytes
/
index.js
File metadata and controls
33 lines (30 loc) · 868 Bytes
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
/**
* @format
*/
import { AppRegistry } from 'react-native';
import 'react-native-gesture-handler';
import messaging from '@react-native-firebase/messaging';
import '@/locales/i18n.config';
import { name as appName } from './app.json';
async function enableMocking() {
await import('./msw.polyfills');
const { server } = await import('./src/mocks/server/');
server.listen({
onUnhandledRequest() {
// console.trace('Here');
},
});
}
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background!', remoteMessage);
});
AppRegistry.registerRunnable(appName, async initialProps => {
try {
await enableMocking();
const App = require('./App').default;
AppRegistry.registerComponent(appName, () => App);
AppRegistry.runApplication(appName, initialProps);
} catch (err) {
console.log(err);
}
});