Network check does not work on iOS

Hello,

I am using the below code to check every 5min if there is an internet connection.
Which is working very fine on Android, but it does not work on iOS (testFlight), can somebody advice whats wrong? thanks.

public void SetConnectionValiability() => StartCoroutine(CheckConnection((isConnected) => { IsOnline = isConnected; }));
        IEnumerator CheckConnection(Action<bool> action)
        {
            const string echoServer = "http://google.com";

            bool result;
            using (var request = UnityWebRequest.Head(echoServer))
            {
                request.timeout = 5;
                yield return request.SendWebRequest();
                result = !request.isNetworkError && !request.isHttpError && request.responseCode == 200;
            }
            action(result);
        }

Also for a commercial game, is it “legal” to ping google like that?

thanks in advance

Solved, for anybody here, use https instead of http.