How to determine if the iPhone is roaming?

I am working on an iPhone application and would really like to determine if the device is roaming so that I can smartly avoid costing my users expensive connections, if they are out of their home network.

I tried to explore Core Telephony framework but did not find anything fruitful.

Is there any API by which I can determine if the user is roaming?

Any help is appreciated, Thanks in advance!!!

This (old) thread tells there is no way to do so with official API:
https://stackoverflow.com/questions/22035231/what-api-to-use-to-check-if-user-is-about-to-use-roaming-call

But you may probably disable some roaming option:
https://developer.apple.com/documentation/devicemanagement/restrictions

I am working on an iPhone application and would really like to
determine if the device is roaming

Claude31 is correct here; indeed, this question has been asked and answered many times here on DevForums (most recently, here).

so that I can smartly avoid costing my users expensive connections, if
they are out of their home network.

Do not do this. The issue is that you’re assuming that roaming equals expensive and that’s simply not the case. I was previously with a carrier that let me roam in a variety of countries with exactly the same costs as in my ‘home’ country.

We recommend that you instead set up your connections (or requests, if you’re using NSURLSession) so that they only run in the right environment. All our recommended networking APIs this via the concept of constrained and expensive configuration options. WWDC 2019 Session 712 Advances in Networking, Part 1 discusses this extensively.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Thanks for the reply. Yes Actually my requirement is similar where I need to detect user roaming status to perform certain operations for my VPN app which works only on cellular (Connect or Disconnect by VPN based on the roaming status). So I tried to reframe the question in similar way and seek for an answer.

By any means can I get user roaming status when user is not on his connected carrier ?
I had exact same question, and went through other posts as well, looking for any luck. By any chance there is further plans to expose roaming status ?

By any chance there is further plans to expose roaming status?

I can’t discuss The Future™. However I can say that this has been a popular request for over a decade now and I think it’s reasonable to draw conclusions based on the fact that it hasn’t happened.

What do you need this for? If, like prashant_ios_nerd, your goal is to avoid expensive network traffic, you should use the constrained and expensive options I’ve discussed above. If it’s something else, please elaborate.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
How to determine if the iPhone is roaming?
 
 
Q