|
@@ -259,6 +259,9 @@
|
|
|
} else if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeAlways) {
|
|
} else if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeAlways) {
|
|
|
|
|
|
|
|
[self reportLocationWithOrder:orderID];
|
|
[self reportLocationWithOrder:orderID];
|
|
|
|
|
+ } else if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeReject) {
|
|
|
|
|
+
|
|
|
|
|
+ [self rejectReportLocationWithReason:[NSString stringWithFormat:@"Driver %@ rejected to report location",RASingleton.sharedInstance.user] forOrder:orderID];
|
|
|
}
|
|
}
|
|
|
completionHandler(UIBackgroundFetchResultNewData);
|
|
completionHandler(UIBackgroundFetchResultNewData);
|
|
|
} else {
|
|
} else {
|
|
@@ -315,6 +318,12 @@
|
|
|
|
|
|
|
|
#pragma mark - Report Location
|
|
#pragma mark - Report Location
|
|
|
|
|
|
|
|
|
|
+- (void)rejectReportLocationWithReason:(NSString *)reason forOrder:(NSString *)orderID {
|
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
|
|
+ [RADataProvider reportLocationWithUserReason:reason forOrder:orderID];
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
- (void)reportLocation:(CLLocation *)location forOrder:(NSString *)orderID {
|
|
- (void)reportLocation:(CLLocation *)location forOrder:(NSString *)orderID {
|
|
|
|
|
|
|
|
if (location) {
|
|
if (location) {
|
|
@@ -338,6 +347,8 @@
|
|
|
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"Report Location For Order:%@",orderID] preferredStyle:UIAlertControllerStyleAlert];
|
|
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"Report Location For Order:%@",orderID] preferredStyle:UIAlertControllerStyleAlert];
|
|
|
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
|
|
|
|
|
+ [self rejectReportLocationWithReason:[NSString stringWithFormat:@"Driver %@ cancel to report location",RASingleton.sharedInstance.user] forOrder:orderID];
|
|
|
|
|
+
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
__weak typeof(self) weakSelf = self;
|
|
__weak typeof(self) weakSelf = self;
|