4

I've come across a scenario where I need to know if the user has turned off mobile data for the app I'm developing so I can display a warning saying: "You have turned off mobile data, data will be synced when you connect to wifi". I wanted to be clear that I only need the information about my own app, not others the user has installed.

The problem is, i only have a narrow lead on where to start. I've come across a post saying this is possible, but not how. The answer talks about a "telephony class" which will enable some way of accessing the data about the settings for mobile data of your app. I'm guessing this is a native iOS class.

Link to the article on SO can be found here - link to post

My question is, which class, if there even is one in swift, has such an api, that I can get this information?

I'm new in swift and therefore know little of native classes and permissions.

I can provide more information if needed. This was all I could think of.

PS. I'm not looking for the Reachability class where I can detect WWAN / WIFI connection, unless this has some capabilities I'm not aware of.

Kind regards Chris

ChrisEenberg
  • 773
  • 1
  • 5
  • 19
  • If you just want to show a message `data will be synced when you connect to wifi` when there is not internet then why you specifically want to know connection type? – Kamran Jun 20 '18 at 09:58
  • 1
    I'm only interested in displaying the message if the user has turned off mobile data. I will update my question to reflect this. sorry about the confusion – ChrisEenberg Jun 20 '18 at 10:09

0 Answers0