Revert "Revert "notificacion desde cita""
This reverts commit 1e09cb470ebdcdb5b0f0e819a9c8484f73031e1c.
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ class MyApp extends StatelessWidget {
|
|||||||
theme: ThemeData(fontFamily: 'Poppins'),
|
theme: ThemeData(fontFamily: 'Poppins'),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: 'ProsApp',
|
title: 'ProsApp',
|
||||||
initialRoute: '/splash',
|
initialRoute: '/',
|
||||||
routes: {
|
routes: {
|
||||||
'/splash': (context) => const SplashScreen(),
|
'/splash': (context) => const SplashScreen(),
|
||||||
'/': (context) => const LoginScreen(),
|
'/': (context) => const LoginScreen(),
|
||||||
|
|||||||
+21
-20
@@ -54,9 +54,6 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
print(token);
|
|
||||||
print(response);
|
|
||||||
response;
|
response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('error al enviar notificacion $e');
|
print('error al enviar notificacion $e');
|
||||||
@@ -201,25 +198,29 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (user?.token != '') {
|
if (user?.token != '') {
|
||||||
final mensajesQuerySnapshot =
|
|
||||||
await FirebaseFirestore.instance
|
|
||||||
.collection('chats')
|
|
||||||
.doc(widget.eventoId)
|
|
||||||
.get();
|
|
||||||
final mensajes =
|
|
||||||
mensajesQuerySnapshot.data()?['message'];
|
|
||||||
if (mensajes != null && mensajes.isNotEmpty) {
|
|
||||||
final ultimoMensaje = mensajes.last;
|
|
||||||
final ultimoMensajeUser = ultimoMensaje['user'];
|
|
||||||
if (ultimoMensajeUser == uid) {
|
|
||||||
// El último mensaje fue enviado por ti, no se envía la notificación
|
|
||||||
} else {
|
|
||||||
sendPushNotification(user!.token!);
|
sendPushNotification(user!.token!);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
sendPushNotification(user!.token!);
|
// if (user?.token != '') {
|
||||||
}
|
// final mensajesQuerySnapshot =
|
||||||
}
|
// await FirebaseFirestore.instance
|
||||||
|
// .collection('chats')
|
||||||
|
// .doc(widget.eventoId)
|
||||||
|
// .get();
|
||||||
|
// final mensajes =
|
||||||
|
// mensajesQuerySnapshot.data()?['message'];
|
||||||
|
// if (mensajes != null && mensajes.isNotEmpty) {
|
||||||
|
// final ultimoMensaje = mensajes.last;
|
||||||
|
// final ultimoMensajeUser = ultimoMensaje['user'];
|
||||||
|
// if (ultimoMensajeUser == uid) {
|
||||||
|
// // El último mensaje fue enviado por ti, no se envía la notificación
|
||||||
|
// } else {
|
||||||
|
// sendPushNotification(user!.token!);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// sendPushNotification(user!.token!);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
_textController.clear();
|
_textController.clear();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user