Browse Source

Cleaning up comments

ErnestoOrtiz2 3 years ago
parent
commit
dad62306e6
1 changed files with 2 additions and 29 deletions
  1. 2
    29
      screens/main/Home_page.js

+ 2
- 29
screens/main/Home_page.js View File

15
 import Constants from 'expo-constants';
15
 import Constants from 'expo-constants';
16
 import * as Notifications from 'expo-notifications';
16
 import * as Notifications from 'expo-notifications';
17
 
17
 
18
-
19
 Notifications.setNotificationHandler({
18
 Notifications.setNotificationHandler({
20
   handleNotification: async () => ({
19
   handleNotification: async () => ({
21
     shouldShowAlert: true,
20
     shouldShowAlert: true,
29
   const [threads, setThreads] = useState([]);  
28
   const [threads, setThreads] = useState([]);  
30
   const [loading, setLoading] = useState(true);
29
   const [loading, setLoading] = useState(true);
31
   const [appointments, setAppointments] = useState([]); 
30
   const [appointments, setAppointments] = useState([]); 
32
-  
33
-  const [roomName, setRoomName] = useState('');
34
-
35
-
36
 
31
 
37
   const [expoPushToken, setExpoPushToken] = useState('');
32
   const [expoPushToken, setExpoPushToken] = useState('');
38
   const [notification, setNotification] = useState(false);
33
   const [notification, setNotification] = useState(false);
39
   const notificationListener = useRef();
34
   const notificationListener = useRef();
40
   const responseListener = useRef();
35
   const responseListener = useRef();
41
 
36
 
42
-
43
   useEffect(() => {
37
   useEffect(() => {
44
     registerForPushNotificationsAsync().then(token => setExpoPushToken(token));
38
     registerForPushNotificationsAsync().then(token => setExpoPushToken(token));
45
     notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
39
     notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
77
           Day:'',
71
           Day:'',
78
           Month:'',
72
           Month:'',
79
           Time:'',
73
           Time:'',
74
+          i_id:'',
75
+          uid1:'',
80
           ...docSnap.data()
76
           ...docSnap.data()
81
         };
77
         };
82
       });
78
       });
83
       setAppointments(appointments);
79
       setAppointments(appointments);
84
       console.log(appointments);
80
       console.log(appointments);
85
     });
81
     });
86
-  
87
       
82
       
88
-    //return () => fire();
89
     return () => {
83
     return () => {
90
       Notifications.removeNotificationSubscription(notificationListener.current);
84
       Notifications.removeNotificationSubscription(notificationListener.current);
91
       Notifications.removeNotificationSubscription(responseListener.current);
85
       Notifications.removeNotificationSubscription(responseListener.current);
98
     return <Loading />;
92
     return <Loading />;
99
   }
93
   }
100
 
94
 
101
-  const sendMessage = (token) => {
102
-    fetch('https://exp.host/--/api/v2/push/send', {
103
-      method: 'POST',
104
-      headers: {
105
-        Accept: 'application/json',
106
-        'Accept-encoding': 'gzip, deflate',
107
-        'Content-type': 'application/json',
108
-      },
109
-      body: JSON.stringify({
110
-        to: token,
111
-        title: 'Ernesto',
112
-        body: 'Freehand message',
113
-        data: { data: 'goes here' },
114
-        _displayInForeground: true,
115
-      }),
116
-    });
117
-  }
118
-
119
   
95
   
120
   function handleButtonPress() {
96
   function handleButtonPress() {
121
       firebase.firestore()
97
       firebase.firestore()
127
             '02yOZHxFcGUX4MNwjeEbAlCShdu1'
103
             '02yOZHxFcGUX4MNwjeEbAlCShdu1'
128
           ]
104
           ]
129
         })
105
         })
130
-        //.then(() => {
131
-          //navigation.navigate('allChats');
132
-         //});
133
   }
106
   }
134
 
107
 
135
   const dimensions = Dimensions.get('window');
108
   const dimensions = Dimensions.get('window');