0
I recently developed an app that uses Aftnetworking 2.0 and ran tests on my physical device using iPhone 4S iOS 8.0. But customers who are with iOS 8.1.1 can not send the data of a registration.
Unfortunately I don’t have a device with iOS 8.1.1 and I don’t intend to update my iPhone for future testing.
The app neither closes nor hangs, but not only does it not send the form.
The weirdest that works normally on emulators, and has even been approved by Apple and is now available on the Apple Store.
And there is a warning for success, and for failure in the operation of Afnetworking.
Someone had the same problem?
Code used:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
// Importante
AFJSONResponseSerializer *serializer = [AFJSONResponseSerializer serializer];
[serializer setReadingOptions:NSJSONReadingAllowFragments];
[manager setResponseSerializer:serializer];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.requestSerializer.timeoutInterval = 120;
// Importante
[manager GET:urlStrin parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
// do whatever you'd like here; for example, if you want to convert
// it to a string and log it, you might do something like:
NSString *string = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
if ([string isEqual: @"SENHA_NAO_CONFERE"]) {
// Caso ocorra um erro e nao consiga salvar primeiro no webservice, ele também não salvará no banco local
//return NO;
app.networkActivityIndicatorVisible = NO;
[self alertaVerificarSenha];
flagVerdadeFalso = [self retornaFalso];
}else{
[self insereDadosAdvogadoBanco];
[self alertadeSucesso];
// 4 - Chama a tela com a lista de
TelaPrevisualizacaoProcessoViewController*telaPrevisualizacao= [self.storyboard instantiateViewControllerWithIdentifier:@"telaPrevisualizacao"];
[self presentViewController: telaPrevisualizacao animated: YES completion: nil];
app.networkActivityIndicatorVisible = NO;
flagVerdadeFalso = [self retornVerdade];
app.networkActivityIndicatorVisible = NO;
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
app.networkActivityIndicatorVisible = NO;
NSLog(@"Error: %@", error);
}];
What specific method are you using @Tiago Amaral ? Here I am using Afnetwork on iOS
8.0
,8.1
,8.1.1
and8.2
hassle-free.– iTSangar
Edited question! I put the source code used.
– Tiago Amaral
The strange thing is that the app doesn’t lock, not the error message, and it doesn’t shut down. It keeps running normal, and the user manages to navigate it as if nothing is wrong. Unfortunately I do not have an iPhone 5/6 to perform the tests in Xcode.
– Tiago Amaral