I recently developed an app that uses AFTNetworking 2.0 and tested on my device using iPhone 4S iOS 8.0. However, iOS 8.1.1 customers can not send data from a registration.
Unfortunately, I do not have a device with iOS 8.1.1 and I do not intend to upgrade my iPhone for future testing purposes.
The app does not close or lock, but not only does it not submit the form.
The weirdest thing that works normally in emulators, and has even been approved by Apple and is already available in the Apple Store.
And there is an alert for success, and for failure to operate AFNetworking.
Has anyone 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);
}];