فهرست منبع

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

Pen Li 7 سال پیش
والد
کامیت
d2e1673da2
2فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 3 1
      Redant Drivers/Apex And Drivers/AppDelegate.m
  2. 3 1
      Redant Drivers/Apex And Drivers/RASingleton.m

+ 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];
+        });
     }
 }