Sfoglia il codice sorgente

1.修改iOS Apex Driver 上传位置为空是默认使用-999,-999。

Pen Li 7 anni fa
parent
commit
e9f2525490
1 ha cambiato i file con 7 aggiunte e 5 eliminazioni
  1. 7 5
      Redant Drivers/Apex And Drivers/AppDelegate.m

+ 7 - 5
Redant Drivers/Apex And Drivers/AppDelegate.m

@@ -359,14 +359,16 @@
 
 - (void)reportLocation:(CLLocation *)location forOrder:(NSString *)orderID {
     
+    NSString *latLon = nil;
     if (location) {
-        NSString *latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
-        dispatch_async(dispatch_get_global_queue(0, 0), ^{
-            [RADataProvider reportCurrentLocation:latLon forOrderID:orderID];
-        });
-    } else {
+        latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
         
+    } else {
+        latLon = @"-999,-999";
     }
+    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+        [RADataProvider reportCurrentLocation:latLon forOrderID:orderID];
+    });
 }
 
 - (void)reportLocationWithOrder:(NSString *)orderID {