CDMA cell data interruption on iPhone. NSError code?

369 views Asked by At

I have a scenario where a NSURLConnection is in progress.

As we all know, CDMA phones (think Verizon, Sprint) can't handle data and phone calls at the same time. Does anyone know what, if any, NSError is returned when the connection is interrupted by a phone call?

Is there any error handling? Does didFailWithError get called or does it automatically go into the background?

Thank you in advance.

2

There are 2 answers

3
Dima On BEST ANSWER

This is a good question. While I do not know the answer to this case specifically but if you implement this NSURLConnection function:

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

And run your code on a device debugging with xcode, you should be able to see for yourself.

edit:

Adding to the other answer, I found the list of all URL errors, so hopefully you can narrow down which one you're looking for. errors

pre-submission edit: I found it! The error is: NSURLErrorCallIsActive

Returned when a connection is attempted while a phone call is active on a network that does not support simultaneous phone and data communication (EDGE or GPRS).

1
Nikhil Dinesh On

//connection:didFailWithError:error

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
 //handle error here
    if([error code] == NSURLErrorCallIsActive)//error code for NSURLErrorCallIsActive = -1019
    {
        //if we can identify the error
    }else{
        //otherwise handle the error generally
    }
}