Update: 2026-07-04 16:47:10

This commit is contained in:
Hamza-Ayed
2026-07-04 16:47:11 +03:00
parent c8fdd1bb5a
commit 838e5ec656
4 changed files with 534 additions and 2 deletions
@@ -49,6 +49,10 @@ Future<bool> onStart(ServiceInstance service) async {
socket.onConnect((_) {
print("✅ Background Service: Socket Connected! ID: ${socket?.id}");
// 🆕 طلب أي رحلات انتظار فاتتنا أثناء انقطاع الخدمة
socket.emit('get_pending_orders');
if (service is AndroidServiceInstance) {
flutterLocalNotificationsPlugin.show(
id: notificationId,
@@ -250,6 +250,10 @@ class LocationController extends GetxController with WidgetsBindingObserver {
if (sid != null || eid != null) {
isSocketConnected = true;
_startHeartbeat();
// 🆕 طلب أي رحلات انتظار فاتتنا أثناء انقطاع الاتصال
Log.print("📦 Requesting pending orders after reconnect...");
socket!.emit('get_pending_orders');
}
});
});