إرسال platform في مصافحة سوكيت السائق — كباتن iOS كانوا يفوتهم الطلب
driver_socket.php عند توزيع الطلب (dispatch_order) يرسل إشعار FCM احتياطياً
**فقط** إذا كانت المنصّة ios، لأن iOS يخنق أحداث السوكيت في الخلفية:
$platform = $connectedDrivers[$driverId]['platform'] ?? 'android';
if ($platform === 'ios' && !empty($token)) { sendFCM_Async(...) }
وتطبيق السائق لم يكن يرسل platform في الـ query إطلاقاً، فالافتراضي
'android' — أي أن كابتن الآيفون لا يستلم الإشعار الاحتياطي ويفوته الطلب وهو
في الخلفية، ويعتمد على السوكيت وحده وهو مخنوق أصلاً.
ظهر بالعين في لوج الإنتاج على جهاز آيفون:
✅ Driver Connected: #243ea897954387c9 (android)
أُضيف الحقل في موضعي الاتصال: location_controller و background_service.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
ef1240b130
commit
e6504acdea
@@ -234,7 +234,16 @@ class LocationController extends GetxController with WidgetsBindingObserver {
|
||||
AppLink.locationSocketUrl,
|
||||
IO.OptionBuilder()
|
||||
.setTransports(['websocket'])
|
||||
.setQuery({'driver_id': driverId, 'token': token, 'EIO': '3'})
|
||||
// إرسال platform إجباري: driver_socket.php يرسل إشعار FCM
|
||||
// احتياطياً عند توزيع الطلب **فقط** إذا كانت المنصّة ios، لأن iOS
|
||||
// يخنق أحداث السوكيت في الخلفية. وبلا هذا الحقل يصير الافتراضي
|
||||
// 'android' فيفوت كابتن الآيفون الطلب وهو في الخلفية.
|
||||
.setQuery({
|
||||
'driver_id': driverId,
|
||||
'token': token,
|
||||
'platform': Platform.isIOS ? 'ios' : 'android',
|
||||
'EIO': '3',
|
||||
})
|
||||
.enableForceNew()
|
||||
.build());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user