Manos Chorianopoulos

crash 1 possible fix

...@@ -4872,13 +4872,36 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2) ...@@ -4872,13 +4872,36 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
4872 // } 4872 // }
4873 [_httpClient.requestSerializer setValue:[@"Bearer " stringByAppendingString:accessToken] forHTTPHeaderField:@"Authorization"]; 4873 [_httpClient.requestSerializer setValue:[@"Bearer " stringByAppendingString:accessToken] forHTTPHeaderField:@"Authorization"];
4874 } 4874 }
4875 +
4876 + NSString *loyaltyDate = @"";
4877 + NSString *loyaltySignature = @"";
4878 + NSString *bundleId = @"";
4879 + @try {
4880 + loyaltyDate = [NSString stringWithFormat:@"%lu", timestamp];
4881 + loyaltySignature = [[NSString stringWithFormat:@"%@%lu", _apiKey, timestamp] SHA256Sum];
4882 + bundleId = [NSString stringWithFormat:@"ios:%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]];
4883 + }
4884 + @catch (NSException *exception) {
4885 + NSLog(@"HTTPHeaders error: %@", exception.reason);
4886 + if (failureBlock) {
4887 + NSError *error = nil;
4888 + failureBlock(error);
4889 + }
4890 + }
4891 + @finally {
4892 +// NSLog(@"Finally condition");
4893 + }
4894 +
4875 [_httpClient.requestSerializer setValue:_webId forHTTPHeaderField:@"loyalty-web-id"]; 4895 [_httpClient.requestSerializer setValue:_webId forHTTPHeaderField:@"loyalty-web-id"];
4876 - [_httpClient.requestSerializer setValue:[NSString stringWithFormat:@"%lu", timestamp] forHTTPHeaderField:@"loyalty-date"]; 4896 +// [_httpClient.requestSerializer setValue:[NSString stringWithFormat:@"%lu", timestamp] forHTTPHeaderField:@"loyalty-date"];
4877 - [_httpClient.requestSerializer setValue:[[NSString stringWithFormat:@"%@%lu", _apiKey, timestamp] SHA256Sum] forHTTPHeaderField:@"loyalty-signature"]; 4897 +// [_httpClient.requestSerializer setValue:[[NSString stringWithFormat:@"%@%lu", _apiKey, timestamp] SHA256Sum] forHTTPHeaderField:@"loyalty-signature"];
4898 + [_httpClient.requestSerializer setValue:loyaltyDate forHTTPHeaderField:@"loyalty-date"];
4899 + [_httpClient.requestSerializer setValue:loyaltySignature forHTTPHeaderField:@"loyalty-signature"];
4878 [_httpClient.requestSerializer setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; 4900 [_httpClient.requestSerializer setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
4879 [_httpClient.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"]; 4901 [_httpClient.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
4880 [_httpClient.requestSerializer setValue:@"gzip" forHTTPHeaderField:@"User-Agent"]; 4902 [_httpClient.requestSerializer setValue:@"gzip" forHTTPHeaderField:@"User-Agent"];
4881 - [_httpClient.requestSerializer setValue:[NSString stringWithFormat:@"ios:%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]] forHTTPHeaderField:@"loyalty-bundle-id"]; 4903 +// [_httpClient.requestSerializer setValue:[NSString stringWithFormat:@"ios:%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]]
4904 + [_httpClient.requestSerializer setValue:bundleId forHTTPHeaderField:@"loyalty-bundle-id"];
4882 [_httpClient.requestSerializer setValue:[[[UIDevice currentDevice] identifierForVendor] UUIDString] forHTTPHeaderField:@"unique-device-id"]; 4905 [_httpClient.requestSerializer setValue:[[[UIDevice currentDevice] identifierForVendor] UUIDString] forHTTPHeaderField:@"unique-device-id"];
4883 [_httpClient.requestSerializer setValue:@"apple" forHTTPHeaderField:@"vendor"]; 4906 [_httpClient.requestSerializer setValue:@"apple" forHTTPHeaderField:@"vendor"];
4884 [_httpClient.requestSerializer setValue:@"platform" forHTTPHeaderField:@"ios"]; 4907 [_httpClient.requestSerializer setValue:@"platform" forHTTPHeaderField:@"ios"];
......