Răsfoiți Sursa

1.修改iOS Apex Drivers连不上服务器时用户交互不响应。

Pen Li 7 ani în urmă
părinte
comite
d2e1673da2

+ 3 - 1
Redant Drivers/Apex And Drivers/AppDelegate.m

@@ -86,7 +86,9 @@ static const NSInteger OrderTypeNew = 2;
     
     if (location) {
         NSString *latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
-        [RADataProvider reportCurrentLocation:latLon];
+        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+           [RADataProvider reportCurrentLocation:latLon];
+        });
     } else {
         
     }

+ 3 - 1
Redant Drivers/Apex And Drivers/RASingleton.m

@@ -95,7 +95,9 @@ static RASingleton *singleton;
 - (void)bindUserWithNotificationToken {
     
     if (_user.length && _password.length && _notificationToken.length) {
-        [RADataProvider bindNitificationToken:self.notificationToken];
+        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+           [RADataProvider bindNitificationToken:self.notificationToken];
+        });
     }
 }