File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 3
3
handleForegroundNotification ,
4
4
handleBackgroundNotifications ,
5
5
registerForPushNotificationsAsync ,
6
- } from "../utils/notifications.new " ;
7
- import messaging from "@react-native-firebase/messaging" ;
6
+ } from "../utils/notifications" ;
7
+ // import messaging from "@react-native-firebase/messaging";
8
8
import * as Notifications from "expo-notifications" ;
9
9
import { router } from "expo-router" ;
10
10
import { getFirebaseApp } from "@/utils/firebase" ;
@@ -15,18 +15,15 @@ export const usePushNotifications = () => {
15
15
16
16
useEffect ( ( ) => {
17
17
const initializeNotifications = async ( ) => {
18
- // Initialize Firebase app
19
- try {
20
- getFirebaseApp ( ) ;
21
- console . log ( "Firebase initialized in RootLayout" ) ;
22
- } catch ( error ) {
23
- console . error ( "Firebase initialization error:" , error ) ;
24
- }
18
+ getFirebaseApp ( ) ;
25
19
26
20
// Register for push notifications and get the push token
27
21
registerForPushNotificationsAsync ( ) . then ( async ( token ) => {
28
22
if ( token ) {
29
- console . log ( "FCM Token:" , token ) ;
23
+ console . log (
24
+ "Finished registerping for Notifications - FCM Token:" ,
25
+ token
26
+ ) ;
30
27
setFcmToken ( token ) ; // Store the push token
31
28
globalFcmToken = token ; // Update the global token
32
29
}
You can’t perform that action at this time.
0 commit comments