1 Reply
      Latest reply on May 14, 2019 2:19 AM by eskimo
      Techies India Inc. Level 1 Level 1 (0 points)

        We are working on app which turns on VPN when mobile is on wifi (in running, background and close state)
        When we turn on/off wifi after 3 minutes in background, we are unable to check the network status and restart the VPN Tunnel.

        Query - How can we check network change using Network Framework in background till the time app is in background mode?

        Note: - We are able to do this with the combination of location and background task but usage of location services is not in our requirement




        • Re: Check Network change in background
          eskimo Apple Staff Apple Staff (11,795 points)

          There’s no mechanism for running code in the background on network changes.  Most folks who need to do this sort of thing use the VPN On Demand architecture.  VPN On Demand has an API, but that API directly maps to configuration profile properties and configuration profiles aren’t considered an API (meaning they’re supported by Apple Support, not by Developer Technical Support).

          You can learn more about this in the iOS Deployment reference (there’s a link to this on the VPN On Demand Rules page) and the Configuration Profile Reference.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"