Question

My iPhone application needs to dial a phone number and send some data to a remote server.

It's important that I:

  1. Trigger the call, and then
  2. set up a background task that will communicate with my server

I've been developing/testing with an AT&T phone, which has no problem sending the data in the background while a phone call is initiated.

However, Verizon customers don't have the ability to call and stream data, so for them, I'd like to reverse my order of operations.

What's the best way to determine which route I need to take? I've seen examples of looking at the iPhone's model number, and if it's 3.3, it means it's Verizon so I can proceed from there, but that doesn't seem robust or future proof. Is Verizon the only carrier that currently has this limitation? Seems like there should be some sort of property like -[UIDevice isMultiTaskingSupported].

Was it helpful?

Solution

There’s no great one-liner like the UIDevice method you mentioned, but there is the Core Telephony framework. I haven’t used it myself, but it seems like you could use the CTCarrier class to find this out, specifically the mobileNetworkCode property. This list should get you started. From the look of it, for some carriers, you can use this code to determine if you’re on EDGE or not. For CDMA or EDGE networks, the answer will be “no” for simultaneously streaming voice and data, but for GSM networks that aren’t EDGE, you’re good. You could also just use the carrierName property and look for “AT&T,” but that doesn’t account for EDGE.

Is there a good solution? Probably not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top