-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (35 loc) · 1.24 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
// Packages Imports
import "expo-asset";
import "react-native-gesture-handler";
import { AppRegistry } from "react-native";
import messaging from "@react-native-firebase/messaging";
import { Provider } from "react-redux";
import PushNotification, { Importance } from "react-native-push-notification";
import { PersistGate } from "redux-persist/integration/react";
// Local Files/App/Components/Store import
import App from "./App";
import configurations from "./config/config";
import { store, persistor } from "./store/configureStore";
PushNotification.createChannel({
channelId: configurations.default_channel_id,
channelName: configurations.default_channel_id,
channelDescription: "A channel to show notifications",
playSound: true,
soundName: "default",
importance: Importance.HIGH,
vibrate: true,
});
// Register background handler
messaging().setBackgroundMessageHandler(async (remoteMessage) => {});
// Headless Check for PushNotifications
function HeadlessCheck({ isHeadless }) {
return isHeadless ? null : (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<App />
</PersistGate>
</Provider>
);
}
// registering the App
AppRegistry.registerComponent("main", () => HeadlessCheck);