Update: 2026-07-04 16:47:10
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user