-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (35 loc) · 1.21 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 "react-native-gesture-handler";
import { AppRegistry } from "react-native";
import messaging from "@react-native-firebase/messaging";
import { PersistGate } from "redux-persist/integration/react";
import { Provider } from "react-redux";
import PushNotification, { Importance } from "react-native-push-notification";
// Local Files/App/Components/Store import
import App from "./App";
import env from "./config/env";
import { store, persistor } from "./store/configureStore";
// Create notification channel
PushNotification.createChannel({
channelId: env.default_channel_id,
channelName: env.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);